text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                tools:ignore="RelativeOverlap">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:alpha="0.87"
                    android:text="@string/allow_content_access"
                    android:textSize="15sp"
                    android:typeface="serif" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:alpha="0.54"
                    android:text="@string/allow_content_access_desc" />

            </LinearLayout>

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/allow_content_access"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                tools:ignore="RelativeOverlap">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:alpha="0.87"
                    android:text="@string/allow_file_access"
                    android:textSize="15sp"
                    android:typeface="serif" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:alpha="0.54"
                    android:text="@string/allow_file_access_desc" />

            </LinearLayout>

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/allow_file_access"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                tools:ignore="RelativeOverlap">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:alpha="0.87"
                    android:text="@string/allow_file_access_from_file_urls"
                    android:textSize="15sp"
                    android:typeface="serif" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:alpha="0.54"
                    android:text="@string/allow_file_access_from_file_urls_desc" />

            </LinearLayout>

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/allow_file_access_from_file_urls"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                tools:ignore="RelativeOverlap">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:alpha="0.87"
                    android:text="@string/allow_universal_access_from_file_urls"
                    android:textSize="15sp"
                    android:typeface="serif" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:alpha="0.54"
                    android:text="@string/allow_universal_access_from_file_urls_desc" />

            </LinearLayout>

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/allow_universal_access_from_file_urls"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                tools:ignore="RelativeOverlap">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:alpha="0.87"
                    android:text="@string/block_network_image"
                    android:textSize="15sp"
                    android:typeface="serif" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:alpha="0.54"
                    android:text="@string/block_network_image_desc" />

            </LinearLayout>

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/block_network_image"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                tools:ignore="RelativeOverlap">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:alpha="0.87"
                    android:text="@string/block_network_loads"
                    android:textSize="15sp"
                    android:typeface="serif" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:alpha="0.54"
                    android:text="@string/block_network_loads_desc" />

            </LinearLayout>

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/block_network_loads"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                tools:ignore="RelativeOverlap">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:alpha="0.87"
                    android:text="@string/built_in_zoom_controls"
                    android:textSize="15sp"
                    android:typeface="serif" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:alpha="0.54"
                    android:text="@string/built_in_zoom_controls_desc" />

            </LinearLayout>

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/built_in_zoom_controls"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                tools:ignore="RelativeOverlap">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:alpha="0.87"
                    android:text="@string/database_enabled"
                    android:textSize="15sp"
                    android:typeface="serif" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:alpha="0.54"
                    android:text="@string/database_enabled_desc" />

            </LinearLayout>

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/database_enabled"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                tools:ignore="RelativeOverlap">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:alpha="0.87"
                    android:text="@string/display_zoom_controls"
                    android:textSize="15sp"
                    android:typeface="serif" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:alpha="0.54"
                    android:text="@string/display_zoom_controls_desc" />

            </LinearLayout>

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/display_zoom_controls"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                tools:ignore="RelativeOverlap">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:alpha="0.87"
                    android:text="@string/dom_storage_enabled"
                    android:textSize="15sp"
                    android:typeface="serif" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:alpha="0.54"
                    android:text="@string/dom_storage_enabled_desc" />

            </LinearLayout>

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/dom_storage_enabled"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                tools:ignore="RelativeOverlap">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:alpha="0.87"
                    android:text="@string/javascript_can_open_windows_automatically"
                    android:textSize="15sp"
                    android:typeface="serif" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:alpha="0.54"
                    android:text="@string/javascript_can_open_windows_automatically_desc" />

            </LinearLayout>

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/javascript_can_open_windows_automatically"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                tools:ignore="RelativeOverlap">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:alpha="0.87"
                    android:text="@string/javascript_enabled"
                    android:textSize="15sp"
                    android:typeface="serif" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:alpha="0.54"
                    android:text="@string/javascript_enabled_desc" />

            </LinearLayout>

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/javascript_enabled"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                tools:ignore="RelativeOverlap">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:alpha="0.87"
                    android:text="@string/load_with_overview_mode"
                    android:textSize="15sp"
                    android:typeface="serif" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:alpha="0.54"
                    android:text="@string/load_with_overview_mode_desc" />

            </LinearLayout>

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/load_with_overview_mode"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true" />

        </RelativeLayout>

        <RelativeLayout
            android:id="@+id/loads_images_automatically_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                tools:ignore="RelativeOverlap">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:alpha="0.87"
                    android:text="@string/loads_images_automatically"
                    android:textSize="15sp"
                    android:typeface="serif" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:alpha="0.54"
                    android:text="@string/loads_images_automatically_desc" />

            </LinearLayout>

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/loads_images_automatically"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                tools:ignore="RelativeOverlap">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:alpha="0.87"
                    android:text="@string/save_form_dats"
                    android:textSize="15sp"
                    android:typeface="serif" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:alpha="0.54"
                    android:text="@string/save_form_data_desc" />

            </LinearLayout>

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/save_form_data"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true" />

        </RelativeLayout>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="16dp">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:orientation="vertical"
                tools:ignore="RelativeOverlap">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:alpha="0.87"
                    android:text="@string/use_wide_view_port"
                    android:textSize="15sp"
                    android:typeface="serif" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="4dp"
                    android:alpha="0.54"
                    android:text="@string/use_wide_view_port_desc" />

            </LinearLayout>

            <android.support.v7.widget.SwitchCompat
                android:id="@+id/use_wide_view_port"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentEnd="true"
                android:layout_alignParentRight="true" />

        </RelativeLayout>

    </LinearLayout>

</android.support.v4.widget.NestedScrollView>


text:
r"""
This code was generated by
\ / _    _  _|   _  _
 | (_)\/(_)(_|\/| |(/_  v1.0.0
      /       /
"""

from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response

class MemberTestCase(IntegrationTestCase):

    def test_fetch_request(self):
        self.holodeck.mock(Response(500, ''))

        with self.assertRaises(TwilioException):
            self.client.ip_messaging.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                       .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                       .members(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch()

        self.holodeck.assert_has_request(Request(
            'get',
            'https://chat.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
        ))

    def test_fetch_response(self):
        self.holodeck.mock(Response(
            200,
            '''
            {
                "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "identity": "jing",
                "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "last_consumed_message_index": null,
                "last_consumption_timestamp": null,
                "date_created": "2016-03-24T21:05:50Z",
                "date_updated": "2016-03-24T21:05:50Z",
                "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
            }
            '''
        ))

        actual = self.client.ip_messaging.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                            .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                            .members(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").fetch()

        self.assertIsNotNone(actual)

    def test_create_request(self):
        self.holodeck.mock(Response(500, ''))

        with self.assertRaises(TwilioException):
            self.client.ip_messaging.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                       .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                       .members.create(identity="identity")

        values = {'Identity': "identity", }

        self.holodeck.assert_has_request(Request(
            'post',
            'https://chat.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members',
            data=values,
        ))

    def test_create_response(self):
        self.holodeck.mock(Response(
            201,
            '''
            {
                "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "identity": "jing",
                "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "last_consumed_message_index": null,
                "last_consumption_timestamp": null,
                "date_created": "2016-03-24T21:05:50Z",
                "date_updated": "2016-03-24T21:05:50Z",
                "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
            }
            '''
        ))

        actual = self.client.ip_messaging.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                            .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                            .members.create(identity="identity")

        self.assertIsNotNone(actual)

    def test_list_request(self):
        self.holodeck.mock(Response(500, ''))

        with self.assertRaises(TwilioException):
            self.client.ip_messaging.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                       .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                       .members.list()

        self.holodeck.assert_has_request(Request(
            'get',
            'https://chat.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members',
        ))

    def test_read_full_response(self):
        self.holodeck.mock(Response(
            200,
            '''
            {
                "meta": {
                    "page": 0,
                    "page_size": 50,
                    "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0",
                    "previous_page_url": null,
                    "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0",
                    "next_page_url": null,
                    "key": "members"
                },
                "members": [
                    {
                        "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                        "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                        "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                        "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                        "identity": "jing",
                        "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                        "last_consumed_message_index": null,
                        "last_consumption_timestamp": null,
                        "date_created": "2016-03-24T21:05:50Z",
                        "date_updated": "2016-03-24T21:05:50Z",
                        "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
                    }
                ]
            }
            '''
        ))

        actual = self.client.ip_messaging.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                            .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                            .members.list()

        self.assertIsNotNone(actual)

    def test_read_empty_response(self):
        self.holodeck.mock(Response(
            200,
            '''
            {
                "meta": {
                    "page": 0,
                    "page_size": 50,
                    "first_page_url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0",
                    "previous_page_url": null,
                    "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members?PageSize=50&Page=0",
                    "next_page_url": null,
                    "key": "members"
                },
                "members": []
            }
            '''
        ))

        actual = self.client.ip_messaging.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                            .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                            .members.list()

        self.assertIsNotNone(actual)

    def test_delete_request(self):
        self.holodeck.mock(Response(500, ''))

        with self.assertRaises(TwilioException):
            self.client.ip_messaging.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                       .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                       .members(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete()

        self.holodeck.assert_has_request(Request(
            'delete',
            'https://chat.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
        ))

    def test_delete_response(self):
        self.holodeck.mock(Response(
            204,
            None,
        ))

        actual = self.client.ip_messaging.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                            .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                            .members(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").delete()

        self.assertTrue(actual)

    def test_update_request(self):
        self.holodeck.mock(Response(500, ''))

        with self.assertRaises(TwilioException):
            self.client.ip_messaging.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                       .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                       .members(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update()

        self.holodeck.assert_has_request(Request(
            'post',
            'https://chat.twilio.com/v1/Services/ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Channels/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Members/MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
        ))

    def test_update_role_sid_response(self):
        self.holodeck.mock(Response(
            200,
            '''
            {
                "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "identity": "jing",
                "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "last_consumed_message_index": null,
                "last_consumption_timestamp": null,
                "date_created": "2016-03-24T21:05:50Z",
                "date_updated": "2016-03-24T21:05:50Z",
                "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
            }
            '''
        ))

        actual = self.client.ip_messaging.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                            .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                            .members(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update()

        self.assertIsNotNone(actual)

    def test_update_last_consumed_message_index_response(self):
        self.holodeck.mock(Response(
            200,
            '''
            {
                "sid": "MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "channel_sid": "CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "service_sid": "ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "identity": "jing",
                "role_sid": "RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
                "last_consumed_message_index": 666,
                "last_consumption_timestamp": null,
                "date_created": "2016-03-24T21:05:50Z",
                "date_updated": "2016-03-24T21:05:50Z",
                "url": "https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
            }
            '''
        ))

        actual = self.client.ip_messaging.v1.services(sid="ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                            .channels(sid="CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
                                            .members(sid="MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX").update()

        self.assertIsNotNone(actual)

redpajama_set_name: RedPajamaGithub


text:
require 'rails_helper'

RSpec.describe 'Course: Assessments: Programming Evaluations Processing', type: :request do
  let(:instance) { create(:instance) }
  with_tenant(:instance) do
    let(:course) { create(:course) }
    let(:user) { create(:user, *user_traits) }
    let(:user_traits) { nil }
    before { login_as(user, scope: :user) }

    context 'when an auto grader is logged in' do
      let(:user_traits) { :auto_grader }

      it 'lists all outstanding evaluations' do
        pending 'Do we need this?'
        fail
      end

      context 'when there are available jobs' do
        it 'allows an evaluator to request for a job' do
          evaluation = create(:course_assessment_programming_evaluation, course: course)
          post allocate_programming_evaluations_path

          response_object = JSON.parse(response.body)['job']
          expect(response_object['id']).not_to be_nil
          evaluation.delete
        end
      end

      it 'allows the evaluation result to be updated' do
        evaluation = create(:course_assessment_programming_evaluation, :assigned, course: course)
        attributes = attributes_for(:course_assessment_programming_evaluation, :completed)
        put programming_evaluation_result_path(evaluation),
            programming_evaluation: attributes.slice(:stdout, :stderr, :test_report)

        expect(response.status).to eq(200)
        evaluation.reload
        expect(evaluation.stdout).to eq(attributes[:stdout])
        expect(evaluation.stderr).to eq(attributes[:stderr])
        expect(evaluation.test_report).to eq(attributes[:test_report])
        expect(evaluation).to be_completed
      end

      context 'when the evaluation is not in the submitted state' do
        it 'fails with HTTP 422' do
          evaluation = create(:course_assessment_programming_evaluation, course: course)
          attributes = attributes_for(:course_assessment_programming_evaluation, :completed)
          put programming_evaluation_result_path(evaluation),
              programming_evaluation: attributes.slice(:stdout, :stderr, :test_report)

          expect(response.status).to eq(422)
        end
      end
    end

    context 'when a course-only auto grader is logged in' do
      let!(:course_user) { create(:course_user, :auto_grader, course: course, user: user) }
      it 'allows the evaluator to request for a job' do
        pending 'Cannot unscope from an active tenant'
        evaluation = create(:course_assessment_programming_evaluation, course: course)
        post allocate_programming_evaluations_path

        response_object = JSON.parse(response.body)['job']
        expect(response_object['id']).to eq(evaluation.id)

        evaluation.reload
        expect(evaluation).to be_assigned
        expect(evaluation.evaluator).to eq(user)

        put programming_evaluation_result_path(evaluation),
            programming_evaluation: { stdout: '', stderr: '', test_report: '' }
      end
    end
  end
end


text:
Me.define('formFieldMap', [
    'formFieldText','formFieldCheckbox','formFieldRadio',
    'formFieldDate','formFieldSelect','formFieldUeditor'
], function (Me) {

    var FormFieldText = Me.formFieldText,
        FormFieldCheckbox = Me.formFieldCheckbox,
        FormFieldRadio = Me.formFieldRadio,
        FormFieldSelect = Me.formFieldSelect,
        FormFieldDate = Me.formFieldDate,
        FormFieldUeditor = Me.formFieldUeditor;

    return {
        checkbox: FormFieldCheckbox,
        date: FormFieldDate,
        radio: FormFieldRadio,
        text: FormFieldText,
        select: FormFieldSelect,
        ueditor: FormFieldUeditor
    }
});


text:
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Umbraco.Cms.Core.IO;
using Umbraco.Cms.Core.Models;
using Umbraco.Cms.Core.Persistence.Repositories;
using Umbraco.Extensions;

namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement
{
    /// <summary>
    /// Represents the Script Repository
    /// </summary>
    internal class ScriptRepository : FileRepository<string, IScript>, IScriptRepository
    {
        public ScriptRepository(FileSystems fileSystems)
            : base(fileSystems.ScriptsFileSystem)
        {
        }

        #region Implementation of IRepository<string,Script>

        public override IScript? Get(string? id)
        {
            if (id is null || FileSystem is null)
            {
                return null;
            }
            // get the relative path within the filesystem
            // (though... id should be relative already)
            var path = FileSystem.GetRelativePath(id);

            if (FileSystem.FileExists(path) == false)
                return null;

            // content will be lazy-loaded when required
            var created = FileSystem.GetCreated(path).UtcDateTime;
            var updated = FileSystem.GetLastModified(path).UtcDateTime;
            //var content = GetFileContent(path);

            var script = new Script(path, file => GetFileContent(file.OriginalPath))
            {
                //id can be the hash
                Id = path.GetHashCode(),
                Key = path.EncodeAsGuid(),
                //Content = content,
                CreateDate = created,
                UpdateDate = updated,
                VirtualPath = FileSystem.GetUrl(path)
            };

            // reset dirty initial properties (U4-1946)
            script.ResetDirtyProperties(false);

            return script;
        }

        public override void Save(IScript entity)
        {
            // TODO: Casting :/ Review GetFileContent and it's usages, need to look into it later
            var script = (Script) entity;

            base.Save(script);

            // ensure that from now on, content is lazy-loaded
            if (script.GetFileContent == null)
                script.GetFileContent = file => GetFileContent(file.OriginalPath);
        }

        public override IEnumerable<IScript> GetMany(params string[]? ids)
        {
            //ensure they are de-duplicated, easy win if people don't do this as this can cause many excess queries
            ids = ids?.Distinct().ToArray();

            if (ids?.Any() ?? false)
            {
                foreach (var id in ids)
                {
                    IScript? script = Get(id);
                    if (script is not null)
                    {
                        yield return script;
                    }
                }
            }
            else
            {
                var files = FindAllFiles("", "*.*");
                foreach (var file in files)
                {
                    IScript? script = Get(file);
                    if (script is not null)
                    {
                        yield return script;
                    }
                }
            }
        }

        #endregion
    }
}


text:
<?php

namespace Afroware\JwTauth;

use Afroware\JwTauth\Support\Utils;
use Afroware\JwTauth\Contracts\Providers\Storage;

class Blacklist
{
    /**
     * The storage.
     *
     * @var \Afroware\JwTauth\Contracts\Providers\Storage
     */
    protected $storage;

    /**
     * The grace period when a token is blacklisted. In seconds.
     *
     * @var int
     */
    protected $gracePeriod = 0;

    /**
     * Number of minutes from issue date in which a JwT can be refreshed.
     *
     * @var int
     */
    protected $refreshTTL = 20160;

    /**
     * The unique key held within the blacklist.
     *
     * @var string
     */
    protected $key = 'jti';

    /**
     * Constructor.
     *
     * @param  \Afroware\JwTauth\Contracts\Providers\Storage  $storage
     *
     * @return void
     */
    public function __construct(Storage $storage)
    {
        $this->storage = $storage;
    }

    /**
     * Add the token (jti claim) to the blacklist.
     *
     * @param  \Afroware\JwTauth\Payload  $payload
     *
     * @return bool
     */
    public function add(Payload $payload)
    {
        // if there is no exp claim then add the jwT to
        // the blacklist indefinitely
        if (! $payload->hasKey('exp')) {
            return $this->addForever($payload);
        }

        $this->storage->add(
            $this->getKey($payload),
            ['valid_until' => $this->getGraceTimestamp()],
            $this->getMinutesUntilExpired($payload)
        );

        return true;
    }

    /**
     * Get the number of minutes until the token expiry.
     *
     * @param  \Afroware\JwTauth\Payload  $payload
     *
     * @return int
     */
    protected function getMinutesUntilExpired(Payload $payload)
    {
        $exp = Utils::timestamp($payload['exp']);
        $iat = Utils::timestamp($payload['iat']);

        // get the latter of the two expiration dates and find
        // the number of minutes until the expiration date,
        // plus 1 minute to avoid overlap
        return $exp->max($iat->addMinutes($this->refreshTTL))->addMinute()->diffInMinutes();
    }

    /**
     * Add the token (jti claim) to the blacklist indefinitely.
     *
     * @param  \Afroware\JwTauth\Payload  $payload
     *
     * @return bool
     */
    public function addForever(Payload $payload)
    {
        $this->storage->forever($this->getKey($payload), 'forever');

        return true;
    }

    /**
     * Determine whether the token has been blacklisted.
     *
     * @param  \Afroware\JwTauth\Payload  $payload
     *
     * @return bool
     */
    public function has(Payload $payload)
    {
        $val = $this->storage->get($this->getKey($payload));

        // exit early if the token was blacklisted forever,
        if ($val === 'forever') {
            return true;
        }

        // check whether the expiry + grace has past
        return ! empty($val) && ! Utils::isFuture($val['valid_until']);
    }

    /**
     * Remove the token (jti claim) from the blacklist.
     *
     * @param  \Afroware\JwTauth\Payload  $payload
     *
     * @return bool
     */
    public function remove(Payload $payload)
    {
        return $this->storage->destroy($this->getKey($payload));
    }

    /**
     * Remove all tokens from the blacklist.
     *
     * @return bool
     */
    public function clear()
    {
        $this->storage->flush();

        return true;
    }

    /**
     * Get the timestamp when the blacklist comes into effect
     * This defaults to immediate (0 seconds).
     *
     * @return int
     */
    protected function getGraceTimestamp()
    {
        return Utils::now()->addSeconds($this->gracePeriod)->getTimestamp();
    }

    /**
     * Set the grace period.
     *
     * @param  int  $gracePeriod
     *
     * @return $this
     */
    public function setGracePeriod($gracePeriod)
    {
        $this->gracePeriod = (int) $gracePeriod;

        return $this;
    }

    /**
     * Get the grace period.
     *
     * @return int
     */
    public function getGracePeriod()
    {
        return $this->gracePeriod;
    }

    /**
     * Get the unique key held within the blacklist.
     *
     * @param  \Afroware\JwTauth\Payload  $payload
     *
     * @return mixed
     */
    public function getKey(Payload $payload)
    {
        return $payload($this->key);
    }

    /**
     * Set the unique key held within the blacklist.
     *
     * @param  string  $key
     *
     * @return $this
     */
    public function setKey($key)
    {
        $this->key = value($key);

        return $this;
    }

    /**
     * Set the refresh time limit.
     *
     * @param  int  $ttl
     *
     * @return $this
     */
    public function setRefreshTTL($ttl)
    {
        $this->refreshTTL = (int) $ttl;

        return $this;
    }

    /**
     * Get the refresh time limit.
     *
     * @return int
     */
    public function getRefreshTTL()
    {
        return $this->refreshTTL;
    }
}


text:
1.  [Overview](#overview)
2.  [Module Description - What the module does and why it is useful](#module-description)
3.  [Installation](#installation)
4.  [Setup - The basics of getting started with influxdb](#setup)
5.  [Usage - Configuration options and additional functionality](#usage)
6.  [Reference - An under-the-hood peek at what the module is doing and how](#reference)
7.  [Limitations - OS compatibility, etc.](#limitations)
8.  [Development - Guide for contributing to the module](#development)
9.  [License](#License)

## Overview

This module manages InfluxDB installation.

[![Build Status](https://travis-ci.org/n1tr0g/golja-influxdb.png)](https://travis-ci.org/n1tr0g/golja-influxdb) [![Puppet Forge](http://img.shields.io/puppetforge/v/golja/influxdb.svg)](https://forge.puppetlabs.com/golja/influxdb)

## Module Description

The InfluxDB module manages both the installation and configuration of InfluxDB.
I am planning to extend it to allow management of InfluxDB resources,
such as databases, users, and privileges.

## Deprecation Warning

Notes for version 5.0.0+:

This module was a refactor of the 4.x version to handle influxdb >= 1.x.
Due to the changes in influxdb 1.x, this module should now support
future change more easily due to thew way the configuration files are
now managed.

Highlights
==========

* The module layout out has changed significantly from previous versions.
* A new fact was added `influxdb_version`.
* The influxdb.conf.erb file was refactored.
* Added and fixed a lot of rspec puppet tests.
* Fixed all the beaker tests, they work now.
* This module now supports influxdb >= 1.x < 2.x
* Major change to the original class parameters now hashes vs individual items.

Notes for version 4.0.0+:

influxdb 1.0.0 contains [breaking changes](https://github.com/influxdata/influxdb/blob/master/CHANGELOG.md#v100-2016-09-08)
which require changing the `data_logging_enabled` config attribute to `trace_logging_enabled`.
The other configuration changes are managed by the `influxdb.conf.erb` template already.

Notes for versions older than 3.1.1:

This release is a major refactoring of the module which means that the API
changed in backwards incompatible ways. If your project depends on the old API
and you need to use influxdb prior to 0.10.X, please pin your module
dependencies to 0.1.2 (0.8.X) or 2.2.2 (0.9.X) version to ensure your environments
don't break.

*NOTE*: Until influxdb 1.0.0 is releases the API of this module may change,
however I will try my best to avoid it.

## Installation

`puppet module install golja/influxdb`

## Setup

### What InfluxDB affects

*   InfluxDB packages
*   InfluxDB configuration files
*   InfluxDB service

### Beginning with InfluxDB

If you just want a server installed with the default options you can
run include `'::influxdb'`.

## Usage

All interaction for the server is done via `influxdb::server`.

Install influxdb

```puppet
class {'influxdb':}
```

```puppet

# These are defaults, but demonstrates how you can change sections of data
$global_config => {
  'bind-address'       => ':8088',
  'reporting-disabled' => false,
}

class {'influxdb':
  global_config  => $global_config,
  manage_repos   => true,
  manage_service => true,
  version        => '1.2.0',
}
```

Enable Graphite plugin with one database

```puppet

# Most of these will be defaults, unless otherwise noted.
$graphite_config = {
  'default' => {
    'enabled'           => true, # not default
    'database'          => "graphite",
    'retention-policy'  => '',
    'bind-address'      => ':2003',
    'protocol'          => 'tcp',
    'consistency-level' => 'one',
    'batch-size'        => 5000,
    'batch-pending'     => 10,
    'batch-timeout'     => '1s',
    'udp-read-buffer'   => 0,
    'separator'         => '.',
    'tags'              => [ "region=us-east", "zone=1c"],
    'templates'         => [ "*.app env.service.resource.measurement" ],
  }
}

class { 'influxdb':
  manage_repos    => true,
  graphite_config => $graphite_config,
}
```

Enable Collectd plugin

```puppet

# most of these are defaults, unless otherwise noted
$collectd_config = {
  'default' => {
    'enabled'          => true, # not default
    'bind-address'     => ':25826',
    'database'         => 'collectd',
    'retention-policy' => '',
    'typesdb'          => '/usr/share/collectd/types.db',
    'batch-size'       => 5000,
    'batch-pending'    => 10,
    'batch-timeout'    => '10s',
    'read-buffer'      => 0,
  }
}

class {'influxdb':
  manage_repos    => true,
  collectd_config => $collectd_config,
}
```

Enable UDP listener

```puppet

# most of these are defaults unless otherwise noted.
$udp_config = {
  'default' => {
    'enabled'          => true, # not default
    'bind-address'     => ':8089',
    'database'         => 'udp',
    'retention-policy' => '',
    'batch-size'       => 5000,
    'batch-pending'    => 10,
    'batch-timeout'    => '1s',
    'read-buffer'      => 0,
  }
}

class {'influxdb':
  manage_repos => true,
  udp_config   => $udp_config
}
```

Enable opentsdb

```puppet

# most of these are defaults unless otherwise noted
$opentsdb_config = {
  'default' => {
    'enabled'           => true, # not default
    'bind-address'      => ':4242',
    'database'          => 'opentsdb',
    'retention-policy'  => '',
    'consistency-level' => 'one',
    'tls-enabled'       => false,
    'certificate'       => '/etc/ssl/influxdb.pem',
    'log-point-errors'  => true,
    'batch-size'        => 1000,
    'batch-pending'     => 5,
    'batch-timeout'     => '1s'
  }
}

class {'influxdb':
  manage_repos    => true,
  opentsdb_config => $opentsdb_config,
}
```

## Reference

### Classes

#### Public classes

*   `influxdb`: Installs and configures InfluxDB.

#### Private classes

*   `influxdb::install`: Installs packages.
*   `influxdb::config`: Configures InfluxDB.
*   `influxdb::repo`: Manages install repo.
*   `influxdb::service`: Manages service.

### Parameters

#### influxdb

##### `ensure`

Allows you to install or remove InfluxDB. Can be 'present' or 'absent'.

##### `version`

Version of InfluxDB.
Default: installed

*NOTE*: installed (will install the latest version if the package repo if not already installed).
        It is highly recommended that you manage this param with a specific version.

##### `config_file`

Path to the config file.
Default: /etc/influxdb/influxdb.conf

##### `conf_template`

The path to the template file that puppet uses to generate the influxdb.conf
Default: influxdb/influxdb.conf.erb

##### `startup_conf_template`

The path to the template file that puppet uses to generate the start config.
Default: influxdb/influxdb_default.erb

##### `service_enabled`

Boolean to decide if the service should be enabled.
Default: true

##### `service_ensure`

String to decide if the service should be running|stopped.
Default: running

##### `manage_service`

Boolean to decide if the service should be managed with puppet or not.
Default: true

##### `manage_repos`

Boolean to decide if the package repos should be managed by puppet.
Default: false

##### `manage_install`

Boolean to decide if puppet should manage the install of packages.
Default: true

##### `influxdb_stderr_log`

Where influx will log stderr messages
Default: /var/log/influxdb/influxd.log

##### `influxdb_stdout_log`

Where influx will log stdout messages
Default: /var/log/influxdb/influxd.log

##### `influxd_opts`

String of startup config options that need to be present.
Default: undef

##### `global_config`

A hash of global configuration options for `influxdb.conf`

*NOTE*: The default for this hash is what is in 1.2.0 of the influx docs.

[Influx Global Options](https://docs.influxdata.com/influxdb/v1.2/administration/config/#global-options)

[params.pp](manifests/params.pp#L21)

##### `meta_config`

A hash of meta configuration options for `influxdb.conf`

*NOTE*: The default for this hash is what is in 1.2.0 of the influx docs

[Influx Meta Options](https://docs.influxdata.com/influxdb/v1.2/administration/config/#meta)

[params.pp](manifests/params.pp#26)

##### `data_config`

A hash of data configuration options for `influxdb.conf`

*NOTE*: The default for this hash is what is in 1.2.0 of the influx docs

[Influx Data Options](https://docs.influxdata.com/influxdb/v1.2/administration/config/#data)

[params.pp](manifests/params.pp#32)

##### `logging_config`

A hash of logging configuration options for `influxdb.conf`

*NOTE*: The default for this hash is what is in 1.5.x of the influx docs

[Influx Logging Options](https://docs.influxdata.com/influxdb/v1.5/administration/config/#logging-settings-logging)

[params.pp](manifests/params.pp#43)

##### `coordinator_config`

A hash of coordinator configuration options for `influxdb.conf`

*NOTE*: The default for this hash is what is in 1.2.0 of the influx docs

[Influx Coordinator Options](https://docs.influxdata.com/influxdb/v1.2/administration/config/#coordinator)

[params.pp](manifests/params.pp#45)

##### `retention_config`

A hash of retention configuration options for `influxdb.conf`

*NOTE*: The default for this hash is what is in 1.2.0 of the influx docs

[Influx Retention Options](https://docs.influxdata.com/influxdb/v1.2/administration/config/#retention)

[params.pp](manifests/params.pp#55)

##### `shard_precreation_config`

A hash of shard_precreation configuration options for `influxdb.conf`

*NOTE*: The default for this hash is what is in 1.2.0 of the influx docs

[Influx Shard Precreation Options](https://docs.influxdata.com/influxdb/v1.2/administration/config/#shard-precreation)

[params.pp](manifests/params.pp#60)

##### `monitor_config`

A hash of monitor configuration options for `influxdb.conf`

*NOTE*: The default for this hash is what is in 1.2.0 of the influx docs

[Influx Monitor Options](https://docs.influxdata.com/influxdb/v1.2/administration/config/#monitor)

[params.pp](manifests/params.pp#66)

##### `admin_config`

A hash of admin configuration options for `influxdb.conf`

*NOTE*: The default for this hash is what is in 1.2.0 of the influx docs

[Influx Admin Options](https://docs.influxdata.com/influxdb/v1.2/administration/config/#admin)

[params.pp](manifests/params.pp#74)

##### `http_config`

A hash of http configuration options for `influxdb.conf`

*NOTE*: The default for this hash is what is in 1.2.0 of the influx docs

[Influx HTTP Options](https://docs.influxdata.com/influxdb/v1.2/administration/config/#http)

[params.pp](manifests/params.pp#81)

##### `subscriber_config`

A hash of subscriber configuration options for `influxdb.conf`

*NOTE*: The default for this hash is what is in 1.2.0 of the influx docs

[Influx Subscriber Options](https://docs.influxdata.com/influxdb/v1.2/administration/config/#subscriber)

[params.pp](manifests/params.pp#99)

##### `graphite_config`

A hash of graphite configuration options for `influxdb.conf`

*NOTE*: The default for this hash is what is in 1.2.0 of the influx docs

[Influx Graphite Options](https://docs.influxdata.com/influxdb/v1.2/administration/config/#graphite)

[params.pp](manifests/params.pp#108)

##### `collectd_config`

A hash of collectd configuration options for `influxdb.conf`

*NOTE*: The default for this hash is what is in 1.2.0 of the influx docs

[Influx Collectd Options](https://docs.influxdata.com/influxdb/v1.2/administration/config/#collectd)

[params.pp](manifests/params.pp#126)

##### `opentsdb_config`

A hash of opentsdb configuration options for `influxdb.conf`

*NOTE*: The default for this hash is what is in 1.2.0 of the influx docs

[Influx Opentsdb Options](https://docs.influxdata.com/influxdb/v1.2/administration/config/#opentsdb)

[params.pp](manifests/params.pp#140)

##### `udp_config`

A hash of udp configuration options for `influxdb.conf`

*NOTE*: The default for this hash is what is in 1.2.0 of the influx docs

[Influx Udp Options](https://docs.influxdata.com/influxdb/v1.2/administration/config/#udp)

[params.pp](manifests/params.pp#156)

##### `continuous_queries_config`

A hash of continuous queries configuration options for `influxdb.conf`

*NOTE*: The default for this hash is what is in 1.2.0 of the influx docs

[Influx Continuous Queries Options](https://docs.influxdata.com/influxdb/v1.2/administration/config/#continuous-queries)

[params.pp](manifests/params.pp#169)

##### `hinted_handoff_config`

This is depcreated as of influxdb >= 1.0
Default: {}

## Limitations

This module has been tested on:

*   Ubuntu 12.04
*   Ubuntu 14.04
*   CentOS 6/7

## Development

In order to better facilitate beaker testing, the Gemfile was modified to
support environment variables.  You must set this enviroment variable
before running `bundle exec *`.  The Gemfile will automatically set this
for you but you can also override it.
```
export BEAKER_VERSION=3.10.0 # assumes ruby >= 2.2.5
```

Please see CONTRIBUTING.md

### Todo

*   Add native types for managing users and databases
*   Add more rspec tests
*   Add beaker/rspec tests

## License

See LICENSE file


text:
class Caminio::MainController < ActionController::Base

  include Caminio::ControllerCommons

  protect_from_forgery with: :exception
  layout 'caminio'

  def index
  end

end


text:
layout:     post
title:      Tweets
date:       2018-02-20
summary:    These are the tweets for February 20, 2018.
categories:
---


text:
package org.apache.maven.archiva.web.action;

import org.apache.archiva.audit.AuditEvent;
import org.easymock.ArgumentsMatcher;

import java.util.Arrays;

public class AuditEventArgumentsMatcher
    implements ArgumentsMatcher
{
    public boolean matches( Object[] objects, Object[] objects1 )
    {
        if ( objects.length != 1 || objects1.length != 1 )
        {
            return false;
        }
        else
        {
            AuditEvent o1 = (AuditEvent) objects[0];
            AuditEvent o2 = (AuditEvent) objects1[0];
            o2.setTimestamp( o1.getTimestamp() ); // effectively ignore the timestamp
            return o1.equals( o2 );
        }
    }

    public String toString( Object[] objects )
    {
        return Arrays.asList( objects ).toString();
    }
}


text:
eper is a loose collection of Erlang Performance related tools.

* `sherk` - a profiler, similar to Linux oprofile or MacOs shark
* `gperf` - a graphical performance monitor; shows CPU, memory and network usage
* `dtop`  - similar to unix top
* `redbug` - similar to the OTP dbg application, but safer, better etc.


text:
namespace chromeos {

namespace device_sync {

class CryptAuthClientFactory;

// CryptAuthEnrollerFactory implementation which utilizes IdentityManager.
class CryptAuthEnrollerFactoryImpl : public CryptAuthEnrollerFactory {
 public:
  CryptAuthEnrollerFactoryImpl(
      CryptAuthClientFactory* cryptauth_client_factory);
  ~CryptAuthEnrollerFactoryImpl() override;

  // CryptAuthEnrollerFactory:
  std::unique_ptr<CryptAuthEnroller> CreateInstance() override;

 private:
  CryptAuthClientFactory* cryptauth_client_factory_;
};

}  // namespace device_sync

}  // namespace chromeos

#endif  // ASH_SERVICES_DEVICE_SYNC_CRYPTAUTH_ENROLLER_FACTORY_IMPL_H_


text:
title: "Page Not Found"
search: exclude
---

Sorry, but the page you were trying to view does not exist — perhaps you can try searching for it.


text:
#import <Foundation/Foundation.h>

#pragma mark - URL Helpers

FOUNDATION_EXPORT NSString *FIRMessagingTokenRegisterServer(void);

#pragma mark - Time

FOUNDATION_EXPORT int64_t FIRMessagingCurrentTimestampInSeconds(void);
FOUNDATION_EXPORT int64_t FIRMessagingCurrentTimestampInMilliseconds(void);

#pragma mark - App Info

FOUNDATION_EXPORT NSString *FIRMessagingCurrentAppVersion(void);
FOUNDATION_EXPORT NSString *FIRMessagingAppIdentifier(void);
FOUNDATION_EXPORT NSString *FIRMessagingFirebaseAppID(void);

#pragma mark - Others

FOUNDATION_EXPORT uint64_t FIRMessagingGetFreeDiskSpaceInMB(void);
FOUNDATION_EXPORT NSSearchPathDirectory FIRMessagingSupportedDirectory(void);

#pragma mark - Device Info
FOUNDATION_EXPORT NSString *FIRMessagingCurrentLocale(void);
FOUNDATION_EXPORT BOOL FIRMessagingHasLocaleChanged(void);
/// locale key stored in GULUserDefaults
FOUNDATION_EXPORT NSString *const kFIRMessagingInstanceIDUserDefaultsKeyLocale;

FOUNDATION_EXPORT NSString *FIRMessagingStringForAPNSDeviceToken(NSData *deviceToken);
FOUNDATION_EXPORT NSString *FIRMessagingAPNSTupleStringForTokenAndServerType(NSData *deviceToken,
                                                                             BOOL isSandbox);

FOUNDATION_EXPORT BOOL FIRMessagingIsSandboxApp(void);


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Calverge: Create group</title>
<link href="bootstrap.css" rel="stylesheet" >
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<form method="get" action="docreate">

    Name of Group
    <input type="text" class="form-control" name="name" placeholder="Enter the name of the group" />

    <input type="submit" class="btn btn-primary" />
</form>


text:
====
epel
====
This element installs the Extra Packages for Enterprise Linux (EPEL)
repository GPG key as well as configuration for yum.

DIB_EPEL_MIRROR:
   :Required: No
   :Default: None
   :Description: To use a EPEL Yum mirror, set this variable to the mirror URL
                 before running bin/disk-image-create. This URL should point to
                 the directory containing the ``5/6/7`` directories.
   :Example: ``DIB\_EPEL\_MIRROR=http://dl.fedoraproject.org/pub/epel``


text:
package org.wtk.component.support.plugin;

import java.util.Iterator;

/**
 * @author Yoav Aharoni
 */
public interface IPluginManager {
	<T extends Plugin> T getPlugin(Class<T> pluginClass);

	Iterator<Plugin> pluginsIterator();
}


text:
package org.apache.pinot.core.operator.filter.predicate;

import org.apache.pinot.core.query.request.context.predicate.EqPredicate;
import org.apache.pinot.core.query.request.context.predicate.Predicate;
import org.apache.pinot.core.segment.index.readers.Dictionary;
import org.apache.pinot.spi.data.FieldSpec.DataType;
import org.apache.pinot.spi.utils.ByteArray;
import org.apache.pinot.spi.utils.BytesUtils;

/**
 * Factory for EQ predicate evaluators.
 */
public class EqualsPredicateEvaluatorFactory {
  private EqualsPredicateEvaluatorFactory() {
  }

  /**
   * Create a new instance of dictionary based EQ predicate evaluator.
   *
   * @param eqPredicate EQ predicate to evaluate
   * @param dictionary Dictionary for the column
   * @return Dictionary based EQ predicate evaluator
   */
  public static BaseDictionaryBasedPredicateEvaluator newDictionaryBasedEvaluator(EqPredicate eqPredicate,
      Dictionary dictionary) {
    return new DictionaryBasedEqPredicateEvaluator(eqPredicate, dictionary);
  }

  /**
   * Create a new instance of raw value based EQ predicate evaluator.
   *
   * @param eqPredicate EQ predicate to evaluate
   * @param dataType Data type for the column
   * @return Raw value based EQ predicate evaluator
   */
  public static BaseRawValueBasedPredicateEvaluator newRawValueBasedEvaluator(EqPredicate eqPredicate,
      DataType dataType) {
    switch (dataType) {
      case INT:
        return new IntRawValueBasedEqPredicateEvaluator(eqPredicate);
      case LONG:
        return new LongRawValueBasedEqPredicateEvaluator(eqPredicate);
      case FLOAT:
        return new FloatRawValueBasedEqPredicateEvaluator(eqPredicate);
      case DOUBLE:
        return new DoubleRawValueBasedEqPredicateEvaluator(eqPredicate);
      case STRING:
        return new StringRawValueBasedEqPredicateEvaluator(eqPredicate);
      case BYTES:
        return new BytesRawValueBasedEqPredicateEvaluator(eqPredicate);
      default:
        throw new UnsupportedOperationException("Unsupported data type: " + dataType);
    }
  }

  private static final class DictionaryBasedEqPredicateEvaluator extends BaseDictionaryBasedPredicateEvaluator {
    final int _matchingDictId;
    final int[] _matchingDictIds;

    DictionaryBasedEqPredicateEvaluator(EqPredicate eqPredicate, Dictionary dictionary) {
      _matchingDictId = dictionary.indexOf(eqPredicate.getValue());
      if (_matchingDictId >= 0) {
        _matchingDictIds = new int[]{_matchingDictId};
        if (dictionary.length() == 1) {
          _alwaysTrue = true;
        }
      } else {
        _matchingDictIds = new int[0];
        _alwaysFalse = true;
      }
    }

    @Override
    public Predicate.Type getPredicateType() {
      return Predicate.Type.EQ;
    }

    @Override
    public boolean applySV(int dictId) {
      return _matchingDictId == dictId;
    }

    @Override
    public int[] getMatchingDictIds() {
      return _matchingDictIds;
    }
  }

  private static final class IntRawValueBasedEqPredicateEvaluator extends BaseRawValueBasedPredicateEvaluator {
    final int _matchingValue;

    IntRawValueBasedEqPredicateEvaluator(EqPredicate eqPredicate) {
      _matchingValue = Integer.parseInt(eqPredicate.getValue());
    }

    @Override
    public Predicate.Type getPredicateType() {
      return Predicate.Type.EQ;
    }

    @Override
    public DataType getDataType() {
      return DataType.INT;
    }

    @Override
    public boolean applySV(int value) {
      return _matchingValue == value;
    }
  }

  private static final class LongRawValueBasedEqPredicateEvaluator extends BaseRawValueBasedPredicateEvaluator {
    final long _matchingValue;

    LongRawValueBasedEqPredicateEvaluator(EqPredicate eqPredicate) {
      _matchingValue = Long.parseLong(eqPredicate.getValue());
    }

    @Override
    public Predicate.Type getPredicateType() {
      return Predicate.Type.EQ;
    }

    @Override
    public DataType getDataType() {
      return DataType.LONG;
    }

    @Override
    public boolean applySV(long value) {
      return (_matchingValue == value);
    }
  }

  private static final class FloatRawValueBasedEqPredicateEvaluator extends BaseRawValueBasedPredicateEvaluator {
    final float _matchingValue;

    FloatRawValueBasedEqPredicateEvaluator(EqPredicate eqPredicate) {
      _matchingValue = Float.parseFloat(eqPredicate.getValue());
    }

    @Override
    public Predicate.Type getPredicateType() {
      return Predicate.Type.EQ;
    }

    @Override
    public DataType getDataType() {
      return DataType.FLOAT;
    }

    @Override
    public boolean applySV(float value) {
      return _matchingValue == value;
    }
  }

  private static final class DoubleRawValueBasedEqPredicateEvaluator extends BaseRawValueBasedPredicateEvaluator {
    final double _matchingValue;

    DoubleRawValueBasedEqPredicateEvaluator(EqPredicate eqPredicate) {
      _matchingValue = Double.parseDouble(eqPredicate.getValue());
    }

    @Override
    public Predicate.Type getPredicateType() {
      return Predicate.Type.EQ;
    }

    @Override
    public DataType getDataType() {
      return DataType.DOUBLE;
    }

    @Override
    public boolean applySV(double value) {
      return _matchingValue == value;
    }
  }

  private static final class StringRawValueBasedEqPredicateEvaluator extends BaseRawValueBasedPredicateEvaluator {
    final String _matchingValue;

    StringRawValueBasedEqPredicateEvaluator(EqPredicate eqPredicate) {
      _matchingValue = eqPredicate.getValue();
    }

    @Override
    public Predicate.Type getPredicateType() {
      return Predicate.Type.EQ;
    }

    @Override
    public DataType getDataType() {
      return DataType.STRING;
    }

    @Override
    public boolean applySV(String value) {
      return _matchingValue.equals(value);
    }
  }

  private static final class BytesRawValueBasedEqPredicateEvaluator extends BaseRawValueBasedPredicateEvaluator {
    final byte[] _matchingValue;

    BytesRawValueBasedEqPredicateEvaluator(EqPredicate eqPredicate) {
      _matchingValue = BytesUtils.toBytes(eqPredicate.getValue());
    }

    @Override
    public Predicate.Type getPredicateType() {
      return Predicate.Type.EQ;
    }

    @Override
    public DataType getDataType() {
      return DataType.BYTES;
    }

    @Override
    public boolean applySV(byte[] value) {
      return ByteArray.compare(_matchingValue, value) == 0;
    }
  }
}


text:
<?php

namespace Tygh;

/**
 * Extension for SimpleXMLElement
 */
class ExSimpleXmlElement extends \SimpleXMLElement
{
    /**
     * Returns count of child elements
     *
     * @return int
     */
    public function exCount()
    {
        return count($this->children());
    }

    /**
     * Add CDATA text in a node
     * @param string $cdata_text The CDATA value to add
     */
    private function addCData($cdata_text)
    {
        $node= dom_import_simplexml($this);
        $no = $node->ownerDocument;
        $node->appendChild($no->createCDATASection($cdata_text));
    }

    /**
     * Create a child with CDATA value
     * @param  string             $name       The name of the child element to add.
     * @param  string             $cdata_text The CDATA value of the child element.
     * @return ExSimpleXMLElement
     */
    public function addChildCData($name, $cdata_text)
    {
        $child = $this->addChild($name);
        $child->addCData($cdata_text);

        return $child;
    }

    /**
     * Add SimpleXMLElement code into a SimpleXMLElement
     * @param  ExSimpleXMLElement $append
     * @return ExSimpleXMLElement
     */
    public function appendXML($append)
    {
        if ($append) {
            if (strlen(trim((string) $append))==0) {
                $xml = $this->addChild($append->getName());
                foreach ($append->children() as $child) {
                    $xml->appendXML($child);
                }
            } else {
                $xml = $this->addChild($append->getName(), (string) $append);
            }

            foreach ($append->attributes() as $n => $v) {
                @$xml->addAttribute($n, $v);
            }

            return $xml;
        }
    }
}


text:
cask v1: 'triumph' do
  version :latest
  sha256 :no_check

  url 'https://www.audiofile-engineering.com/triumph/download/Triumph.dmg'
  name 'Triumph'
  homepage 'https://www.audiofile-engineering.com/triumph/'
  license :unknown    # todo: change license and remove this comment; ':unknown' is a machine-generated placeholder

  app 'Triumph.app'
  app 'Triumph.app/Contents/Applications/DDP Player.app'
end


text:
package r_kvstore

//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing, software
//distributed under the License is distributed on an "AS IS" BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
//
// Code generated by Alibaba Cloud SDK Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.

import (
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
	"github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
)

// RenewInstance invokes the r_kvstore.RenewInstance API synchronously
// api document: https://help.aliyun.com/api/r-kvstore/renewinstance.html
func (client *Client) RenewInstance(request *RenewInstanceRequest) (response *RenewInstanceResponse, err error) {
	response = CreateRenewInstanceResponse()
	err = client.DoAction(request, response)
	return
}

// RenewInstanceWithChan invokes the r_kvstore.RenewInstance API asynchronously
// api document: https://help.aliyun.com/api/r-kvstore/renewinstance.html
// asynchronous document: https://help.aliyun.com/document_detail/66220.html
func (client *Client) RenewInstanceWithChan(request *RenewInstanceRequest) (<-chan *RenewInstanceResponse, <-chan error) {
	responseChan := make(chan *RenewInstanceResponse, 1)
	errChan := make(chan error, 1)
	err := client.AddAsyncTask(func() {
		defer close(responseChan)
		defer close(errChan)
		response, err := client.RenewInstance(request)
		if err != nil {
			errChan <- err
		} else {
			responseChan <- response
		}
	})
	if err != nil {
		errChan <- err
		close(responseChan)
		close(errChan)
	}
	return responseChan, errChan
}

// RenewInstanceWithCallback invokes the r_kvstore.RenewInstance API asynchronously
// api document: https://help.aliyun.com/api/r-kvstore/renewinstance.html
// asynchronous document: https://help.aliyun.com/document_detail/66220.html
func (client *Client) RenewInstanceWithCallback(request *RenewInstanceRequest, callback func(response *RenewInstanceResponse, err error)) <-chan int {
	result := make(chan int, 1)
	err := client.AddAsyncTask(func() {
		var response *RenewInstanceResponse
		var err error
		defer close(result)
		response, err = client.RenewInstance(request)
		callback(response, err)
		result <- 1
	})
	if err != nil {
		defer close(result)
		callback(nil, err)
		result <- 0
	}
	return result
}

// RenewInstanceRequest is the request struct for api RenewInstance
type RenewInstanceRequest struct {
	*requests.RpcRequest
	ResourceOwnerId      requests.Integer `position:"Query" name:"ResourceOwnerId"`
	CouponNo             string           `position:"Query" name:"CouponNo"`
	InstanceClass        string           `position:"Query" name:"InstanceClass"`
	Capacity             string           `position:"Query" name:"Capacity"`
	SecurityToken        string           `position:"Query" name:"SecurityToken"`
	BusinessInfo         string           `position:"Query" name:"BusinessInfo"`
	Period               requests.Integer `position:"Query" name:"Period"`
	AutoPay              requests.Boolean `position:"Query" name:"AutoPay"`
	FromApp              string           `position:"Query" name:"FromApp"`
	ResourceOwnerAccount string           `position:"Query" name:"ResourceOwnerAccount"`
	OwnerAccount         string           `position:"Query" name:"OwnerAccount"`
	OwnerId              requests.Integer `position:"Query" name:"OwnerId"`
	InstanceId           string           `position:"Query" name:"InstanceId"`
	ForceUpgrade         requests.Boolean `position:"Query" name:"ForceUpgrade"`
}

// RenewInstanceResponse is the response struct for api RenewInstance
type RenewInstanceResponse struct {
	*responses.BaseResponse
	RequestId string `json:"RequestId" xml:"RequestId"`
	OrderId   string `json:"OrderId" xml:"OrderId"`
	EndTime   string `json:"EndTime" xml:"EndTime"`
}

// CreateRenewInstanceRequest creates a request to invoke RenewInstance API
func CreateRenewInstanceRequest() (request *RenewInstanceRequest) {
	request = &RenewInstanceRequest{
		RpcRequest: &requests.RpcRequest{},
	}
	request.InitWithApiInfo("R-kvstore", "2015-01-01", "RenewInstance", "redisa", "openAPI")
	return
}

// CreateRenewInstanceResponse creates a response to parse from RenewInstance response
func CreateRenewInstanceResponse() (response *RenewInstanceResponse) {
	response = &RenewInstanceResponse{
		BaseResponse: &responses.BaseResponse{},
	}
	return
}


text:
package samples.websocket.snake;

import java.io.IOException;

import org.junit.Test;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.BDDMockito.willThrow;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;

public class SnakeTimerTests {

	@Test
	public void removeDysfunctionalSnakes() throws Exception {
		Snake snake = mock(Snake.class);
		willThrow(new IOException()).given(snake).sendMessage(anyString());
		SnakeTimer.addSnake(snake);

		SnakeTimer.broadcast("");
		assertThat(SnakeTimer.getSnakes().size(), is(0));
	}
}


text:
package org.elasticsearch.repositories.blobstore;

import static java.util.Collections.emptyMap;
import static java.util.Collections.unmodifiableMap;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.message.ParameterizedMessage;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.common.lucene.Lucene;
import org.elasticsearch.common.util.iterable.Iterables;
import org.elasticsearch.index.shard.ShardId;
import org.elasticsearch.index.snapshots.IndexShardRestoreFailedException;
import org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshot;
import org.elasticsearch.index.snapshots.blobstore.SnapshotFiles;
import org.elasticsearch.index.store.Store;
import org.elasticsearch.index.store.StoreFileMetadata;
import org.elasticsearch.indices.recovery.RecoveryState;
import org.elasticsearch.snapshots.SnapshotId;

/**
 * This context will execute a file restore of the lucene files. It is primarily designed to be used to
 * restore from some form of a snapshot. It will setup a new store, identify files that need to be copied
 * for the source, and perform the copies. Implementers must implement the functionality of opening the
 * underlying file streams for snapshotted lucene file.
 */
public abstract class FileRestoreContext {

    private static final Logger LOGGER = LogManager.getLogger(FileRestoreContext.class);

    protected final String repositoryName;
    protected final RecoveryState recoveryState;
    protected final SnapshotId snapshotId;
    protected final ShardId shardId;

    /**
     * Constructs new restore context
     *
     * @param shardId       shard id to restore into
     * @param snapshotId    snapshot id
     * @param recoveryState recovery state to report progress
     */
    protected FileRestoreContext(String repositoryName, ShardId shardId, SnapshotId snapshotId, RecoveryState recoveryState) {
        this.repositoryName = repositoryName;
        this.recoveryState = recoveryState;
        this.snapshotId = snapshotId;
        this.shardId = shardId;
    }

    /**
     * Performs restore operation
     */
    public void restore(SnapshotFiles snapshotFiles, Store store, ActionListener<Void> listener) {
        store.incRef();
        try {
            LOGGER.debug("[{}] [{}] restoring to [{}] ...", snapshotId, repositoryName, shardId);
            Store.MetadataSnapshot recoveryTargetMetadata;
            try {
                // this will throw an IOException if the store has no segments infos file. The
                // store can still have existing files but they will be deleted just before being
                // restored.
                recoveryTargetMetadata = store.getMetadata(null, true);
            } catch (org.apache.lucene.index.IndexNotFoundException e) {
                // happens when restore to an empty shard, not a big deal
                LOGGER.trace("[{}] [{}] restoring from to an empty shard", shardId, snapshotId);
                recoveryTargetMetadata = Store.MetadataSnapshot.EMPTY;
            } catch (IOException e) {
                LOGGER.warn(new ParameterizedMessage("[{}] [{}] Can't read metadata from store, will not reuse local files during restore",
                                                     shardId, snapshotId), e);
                recoveryTargetMetadata = Store.MetadataSnapshot.EMPTY;
            }
            final List<BlobStoreIndexShardSnapshot.FileInfo> filesToRecover = new ArrayList<>();
            final Map<String, StoreFileMetadata> snapshotMetadata = new HashMap<>();
            final Map<String, BlobStoreIndexShardSnapshot.FileInfo> fileInfos = new HashMap<>();
            for (final BlobStoreIndexShardSnapshot.FileInfo fileInfo : snapshotFiles.indexFiles()) {
                snapshotMetadata.put(fileInfo.metadata().name(), fileInfo.metadata());
                fileInfos.put(fileInfo.metadata().name(), fileInfo);
            }

            final Store.MetadataSnapshot sourceMetadata = new Store.MetadataSnapshot(unmodifiableMap(snapshotMetadata), emptyMap(), 0);

            final StoreFileMetadata restoredSegmentsFile = sourceMetadata.getSegmentsFile();
            if (restoredSegmentsFile == null) {
                throw new IndexShardRestoreFailedException(shardId, "Snapshot has no segments file");
            }

            final Store.RecoveryDiff diff = sourceMetadata.recoveryDiff(recoveryTargetMetadata);
            for (StoreFileMetadata md : diff.identical) {
                BlobStoreIndexShardSnapshot.FileInfo fileInfo = fileInfos.get(md.name());
                recoveryState.getIndex().addFileDetail(fileInfo.physicalName(), fileInfo.length(), true);
                if (LOGGER.isTraceEnabled()) {
                    LOGGER.trace("[{}] [{}] not_recovering file [{}] from [{}], exists in local store and is same", shardId, snapshotId,
                                 fileInfo.physicalName(), fileInfo.name());
                }
            }

            for (StoreFileMetadata md : concat(diff)) {
                BlobStoreIndexShardSnapshot.FileInfo fileInfo = fileInfos.get(md.name());
                filesToRecover.add(fileInfo);
                recoveryState.getIndex().addFileDetail(fileInfo.physicalName(), fileInfo.length(), false);
                if (LOGGER.isTraceEnabled()) {
                    LOGGER.trace("[{}] [{}] recovering [{}] from [{}]", shardId, snapshotId,
                                 fileInfo.physicalName(), fileInfo.name());
                }
            }

            if (filesToRecover.isEmpty()) {
                LOGGER.trace("[{}] [{}] no files to recover, all exist within the local store", shardId, snapshotId);
            }

            try {
                // list of all existing store files
                final List<String> deleteIfExistFiles = Arrays.asList(store.directory().listAll());

                for (final BlobStoreIndexShardSnapshot.FileInfo fileToRecover : filesToRecover) {
                    // if a file with a same physical name already exist in the store we need to delete it
                    // before restoring it from the snapshot. We could be lenient and try to reuse the existing
                    // store files (and compare their names/length/checksum again with the snapshot files) but to
                    // avoid extra complexity we simply delete them and restore them again like StoreRecovery
                    // does with dangling indices. Any existing store file that is not restored from the snapshot
                    // will be clean up by RecoveryTarget.cleanFiles().
                    final String physicalName = fileToRecover.physicalName();
                    if (deleteIfExistFiles.contains(physicalName)) {
                        LOGGER.trace("[{}] [{}] deleting pre-existing file [{}]", shardId, snapshotId, physicalName);
                        store.directory().deleteFile(physicalName);
                    }
                }

                restoreFiles(filesToRecover, store, ActionListener.wrap(
                    v -> {
                        store.incRef();
                        try {
                            afterRestore(snapshotFiles, store, restoredSegmentsFile);
                            listener.onResponse(null);
                        } finally {
                            store.decRef();
                        }
                    }, listener::onFailure));
            } catch (IOException ex) {
                throw new IndexShardRestoreFailedException(shardId, "Failed to recover index", ex);
            }
        } catch (Exception e) {
            listener.onFailure(e);
        } finally {
            store.decRef();
        }
    }

    private void afterRestore(SnapshotFiles snapshotFiles, Store store, StoreFileMetadata restoredSegmentsFile) {
        // read the snapshot data persisted
        try {
            Lucene.pruneUnreferencedFiles(restoredSegmentsFile.name(), store.directory());
        } catch (IOException e) {
            throw new IndexShardRestoreFailedException(shardId, "Failed to fetch index version after copying it over", e);
        }

        /// now, go over and clean files that are in the store, but were not in the snapshot
        try {
            for (String storeFile : store.directory().listAll()) {
                if (Store.isAutogenerated(storeFile) || snapshotFiles.containPhysicalIndexFile(storeFile)) {
                    continue; //skip write.lock, checksum files and files that exist in the snapshot
                }
                try {
                    store.deleteQuiet("restore", storeFile);
                    store.directory().deleteFile(storeFile);
                } catch (IOException e) {
                    LOGGER.warn("[{}] [{}] failed to delete file [{}] during snapshot cleanup", shardId, snapshotId, storeFile);
                }
            }
        } catch (IOException e) {
            LOGGER.warn("[{}] [{}] failed to list directory - some of files might not be deleted", shardId, snapshotId);
        }
    }

    /**
     * Restores given list of {@link BlobStoreIndexShardSnapshot.FileInfo} to the given {@link Store}.
     *
     * @param filesToRecover List of files to restore
     * @param store          Store to restore into
     */
    protected abstract void restoreFiles(List<BlobStoreIndexShardSnapshot.FileInfo> filesToRecover, Store store,
                                         ActionListener<Void> listener);

    @SuppressWarnings("unchecked")
    private static Iterable<StoreFileMetadata> concat(Store.RecoveryDiff diff) {
        return Iterables.concat(diff.different, diff.missing);
    }
}


text:
"""
Animated demo showing progress of Bayesian optimization on a simple
two-dimensional function.
"""

from __future__ import division
from __future__ import absolute_import
from __future__ import print_function

import numpy as np

from reggie import make_gp, MCMC
from ezplot import figure, show

from pybo import inits
from pybo import policies
from pybo import solvers
from pybo import recommenders

__all__ = []

def f(x):
    """
    Test function we'll optimize. This is a 1d, sinusoidal function used by
    Gramacy and Lee in "Cases for the nugget in modeling computer experiments".
    """
    x = np.array(x, ndmin=2)

    y = (x[:, 1]-(5.1/(4*np.pi**2))*x[:, 0]**2+5*x[:, 0]/np.pi-6)**2
    y += 10*(1-1/(8*np.pi))*np.cos(x[:, 0])+10
    # NOTE: this rescales branin by 10 to make it more manageable.
    y /= 10.
    return -np.squeeze(y)

def main():
    """Run the demo."""
    # define the bounds over which we'll optimize, the optimal x for comparison,
    # and a sequence of test points
    bounds = np.array([[-5, 10.], [0, 15]])
    xopt = np.array([np.pi, 2.275])
    x1, x2 = np.meshgrid(np.linspace(*bounds[0], num=100),
                         np.linspace(*bounds[1], num=100))
    xx = np.c_[x1.flatten(), x2.flatten()]

    # get initial data and some test points.
    X = list(inits.init_latin(bounds, 6))
    Y = [f(x_) for x_ in X]
    F = list()

    # initialize the model
    model = make_gp(0.01, 10, [1., 1.], 0)
    model.add_data(X, Y)

    # set a prior on the parameters
    model.params['like.sn2'].set_prior('uniform', 0.005, 0.015)
    model.params['kern.rho'].set_prior('lognormal', 0, 3)
    model.params['kern.ell'].set_prior('lognormal', 0, 3)
    model.params['mean.bias'].set_prior('normal', 0, 20)

    # make a model which samples parameters
    model = MCMC(model, n=10, rng=None)

    # create a new figure
    fig = figure(figsize=(10, 6))

    while True:
        # get index to solve it and plot it
        index = policies.EI(model, bounds, X, xi=0.1)

        # get the recommendation and the next query
        xbest = recommenders.best_incumbent(model, bounds, X)
        xnext, _ = solvers.solve_lbfgs(index, bounds)

        # observe and update model
        ynext = f(xnext)
        model.add_data(xnext, ynext)

        # evaluate the posterior and the acquisition function
        mu, s2 = model.predict(xx)

        # record our data and update the model
        X.append(xnext)
        Y.append(ynext)
        F.append(f(xbest))

        fig.clear()
        ax1 = fig.add_subplotspec((2, 2), (0, 0), hidex=True)
        ax2 = fig.add_subplotspec((2, 2), (1, 0), hidey=True, sharex=ax1)
        ax3 = fig.add_subplotspec((2, 2), (0, 1), rowspan=2)

        # plot the posterior and data
        ax1.contourf(x1, x2, mu.reshape(x1.shape), alpha=0.4)
        X_ = np.array(X)
        ax1.scatter(X_[:-1, 0], X_[:-1, 1], marker='.')
        ax1.scatter(xbest[0], xbest[1], linewidths=3, marker='o', color='r')
        ax1.scatter(xnext[0], xnext[1], linewidths=3, marker='o', color='g')
        ax1.set_xlim(*bounds[0])
        ax1.set_ylim(*bounds[1])
        ax1.set_title('current model (xbest and xnext)')

        # plot the acquisition function
        ax2.contourf(x1, x2, index(xx).reshape(x1.shape), alpha=0.5)
        ax2.scatter(xbest[0], xbest[1], linewidths=3, marker='o', color='r')
        ax2.scatter(xnext[0], xnext[1], linewidths=3, marker='o', color='g')
        ax2.set_xlim(*bounds[0])
        ax2.set_ylim(*bounds[1])
        ax2.set_title('current policy (xnext)')

        # plot the latent function at recomended points
        ax3.axhline(f(xopt))
        ax3.plot(F)
        ax3.set_ylim(-1., 0.)
        ax3.set_title('value of recommendation')

        # draw
        fig.canvas.draw()
        show(block=False)

if __name__ == '__main__':
    main()


text:
package com.amazonaws.services.datapipeline.model.transform;

import java.math.*;

import javax.annotation.Generated;

import com.amazonaws.services.datapipeline.model.*;
import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*;
import com.amazonaws.transform.*;

import com.fasterxml.jackson.core.JsonToken;
import static com.fasterxml.jackson.core.JsonToken.*;

/**
 * PutPipelineDefinitionResult JSON Unmarshaller
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class PutPipelineDefinitionResultJsonUnmarshaller implements Unmarshaller<PutPipelineDefinitionResult, JsonUnmarshallerContext> {

    public PutPipelineDefinitionResult unmarshall(JsonUnmarshallerContext context) throws Exception {
        PutPipelineDefinitionResult putPipelineDefinitionResult = new PutPipelineDefinitionResult();

        int originalDepth = context.getCurrentDepth();
        String currentParentElement = context.getCurrentParentElement();
        int targetDepth = originalDepth + 1;

        JsonToken token = context.getCurrentToken();
        if (token == null)
            token = context.nextToken();
        if (token == VALUE_NULL) {
            return putPipelineDefinitionResult;
        }

        while (true) {
            if (token == null)
                break;

            if (token == FIELD_NAME || token == START_OBJECT) {
                if (context.testExpression("validationErrors", targetDepth)) {
                    context.nextToken();
                    putPipelineDefinitionResult.setValidationErrors(new ListUnmarshaller<ValidationError>(ValidationErrorJsonUnmarshaller.getInstance())
                            .unmarshall(context));
                }
                if (context.testExpression("validationWarnings", targetDepth)) {
                    context.nextToken();
                    putPipelineDefinitionResult.setValidationWarnings(new ListUnmarshaller<ValidationWarning>(ValidationWarningJsonUnmarshaller.getInstance())
                            .unmarshall(context));
                }
                if (context.testExpression("errored", targetDepth)) {
                    context.nextToken();
                    putPipelineDefinitionResult.setErrored(context.getUnmarshaller(Boolean.class).unmarshall(context));
                }
            } else if (token == END_ARRAY || token == END_OBJECT) {
                if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {
                    if (context.getCurrentDepth() <= originalDepth)
                        break;
                }
            }
            token = context.nextToken();
        }

        return putPipelineDefinitionResult;
    }

    private static PutPipelineDefinitionResultJsonUnmarshaller instance;

    public static PutPipelineDefinitionResultJsonUnmarshaller getInstance() {
        if (instance == null)
            instance = new PutPipelineDefinitionResultJsonUnmarshaller();
        return instance;
    }
}


text:
package cz.metacentrum.perun.audit.events.RegistrarManagerEvents;

import cz.metacentrum.perun.audit.events.AuditEvent;
import cz.metacentrum.perun.audit.events.EngineIgnoreEvent;
import cz.metacentrum.perun.registrar.model.ApplicationForm;

public class FormItemDeleted extends AuditEvent implements EngineIgnoreEvent {

	private ApplicationForm form;
	private String message;

	@SuppressWarnings("unused") // used by jackson mapper
	public FormItemDeleted() {
	}

	public FormItemDeleted(ApplicationForm form) {
		this.form = form;
		this.message = formatMessage("Application form item ID=%d voID=%d %s has been deleted", form.getId(),
				form.getVo().getId(), ((form.getGroup() != null) ? " groupID=" + form.getGroup().getId() : ""));
	}

	@Override
	public String getMessage() {
		return message;
	}

	public ApplicationForm getForm() {
		return form;
	}

	@Override
	public String toString() {
		return message;
	}
}


text: based on https://github.com/edgemaster/gitlab-irc-bot.git


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
?>

            	Statistics

            	<?php echo $stats; ?>


text: training howtomcatworks book