text:
from ..broker import Broker

class SystemHealthSummaryBroker(Broker):
    controller = "system_health_summaries"

    def show(self, **kwargs):
        """Shows the details for the specified system health summary.

            **Inputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` True
            |  ``default:`` None

             :param id: The internal NetMRI identifier of the system health summary.
             :type id: Integer

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param methods: A list of system health summary methods. The listed methods will be called on each system health summary returned and included in the output. Available methods are: data_source.
             :type methods: Array of String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param include: A list of associated object types to include in the output. The listed associations will be returned as outputs named according to the association name (see outputs below). Available includes are: data_source.
             :type include: Array of String

            **Outputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return system_health_summary: The system health summary identified by the specified id.
             :rtype system_health_summary: SystemHealthSummary

            """

        return self.api_request(self._get_method_fullname("show"), kwargs)

    def index(self, **kwargs):
        """Lists the available system health summaries. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lists, using this method is most efficient.

            **Inputs**

            |  ``api version min:`` 2.9
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param id: No description is available for id.
             :type id: Array of String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param methods: A list of system health summary methods. The listed methods will be called on each system health summary returned and included in the output. Available methods are: data_source.
             :type methods: Array of String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param include: A list of associated object types to include in the output. The listed associations will be returned as outputs named according to the association name (see outputs below). Available includes are: data_source.
             :type include: Array of String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` 0

             :param start: The record number to return in the selected page of data. It will always appear, although it may not be the first record. See the :limit for more information.
             :type start: Integer

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` 1000

             :param limit: The size of the page of data, that is, the maximum number of records returned. The limit size will be used to break the data up into pages and the first page with the start record will be returned. So if you have 100 records and use a :limit of 10 and a :start of 10, you will get records 10-19. The maximum limit is 10000.
             :type limit: Integer

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` id

             :param sort: The data field(s) to use for sorting the output. Default is id. Valid values are id, datasource_id, timestamp, category, diagnostic, status, entry_type, visibility, message_code, message, silenceable_ind, silenced_ind, updated_at, subcategory.
             :type sort: Array of String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` asc

             :param dir: The direction(s) in which to sort the data. Default is 'asc'. Valid values are 'asc' and 'desc'.
             :type dir: Array of String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param select: The list of attributes to return for each SystemHealthSummary. Valid values are id, datasource_id, timestamp, category, diagnostic, status, entry_type, visibility, message_code, message, silenceable_ind, silenced_ind, updated_at, subcategory. If empty or omitted, all attributes will be returned.
             :type select: Array

            |  ``api version min:`` 2.8
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param goto_field: The field name for NIOS GOTO that is used for locating a row position of records.
             :type goto_field: String

            |  ``api version min:`` 2.8
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param goto_value: The value of goto_field for NIOS GOTO that is used for locating a row position of records.
             :type goto_value: String

            **Outputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return system_health_summaries: An array of the SystemHealthSummary objects that match the specified input criteria.
             :rtype system_health_summaries: Array of SystemHealthSummary

            """

        return self.api_list_request(self._get_method_fullname("index"), kwargs)

    def search(self, **kwargs):
        """Lists the available system health summaries matching the input criteria. This method provides a more flexible search interface than the index method, but searching using this method is more demanding on the system and will not perform to the same level as the index method. The input fields listed below will be used as in the index method, to filter the result, along with the optional query string and XML filter described below.

            **Inputs**

            |  ``api version min:`` 2.9
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param category: No description is available for category.
             :type category: Array of String

            |  ``api version min:`` 2.9
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param datasource_id: No description is available for datasource_id.
             :type datasource_id: Array of String

            |  ``api version min:`` 2.9
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param diagnostic: No description is available for diagnostic.
             :type diagnostic: Array of String

            |  ``api version min:`` 2.9
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param entry_type: No description is available for entry_type.
             :type entry_type: Array of String

            |  ``api version min:`` 2.9
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param id: No description is available for id.
             :type id: Array of String

            |  ``api version min:`` 2.9
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param message: No description is available for message.
             :type message: Array of String

            |  ``api version min:`` 2.9
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param message_code: No description is available for message_code.
             :type message_code: Array of String

            |  ``api version min:`` 2.9
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param silenceable_ind: No description is available for silenceable_ind.
             :type silenceable_ind: Array of String

            |  ``api version min:`` 2.9
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param silenced_ind: No description is available for silenced_ind.
             :type silenced_ind: Array of String

            |  ``api version min:`` 2.9
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param status: No description is available for status.
             :type status: Array of String

            |  ``api version min:`` 2.9
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param subcategory: No description is available for subcategory.
             :type subcategory: Array of String

            |  ``api version min:`` 2.9
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param timestamp: No description is available for timestamp.
             :type timestamp: Array of String

            |  ``api version min:`` 2.9
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param updated_at: No description is available for updated_at.
             :type updated_at: Array of String

            |  ``api version min:`` 2.9
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param visibility: No description is available for visibility.
             :type visibility: Array of String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param methods: A list of system health summary methods. The listed methods will be called on each system health summary returned and included in the output. Available methods are: data_source.
             :type methods: Array of String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param include: A list of associated object types to include in the output. The listed associations will be returned as outputs named according to the association name (see outputs below). Available includes are: data_source.
             :type include: Array of String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` 0

             :param start: The record number to return in the selected page of data. It will always appear, although it may not be the first record. See the :limit for more information.
             :type start: Integer

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` 1000

             :param limit: The size of the page of data, that is, the maximum number of records returned. The limit size will be used to break the data up into pages and the first page with the start record will be returned. So if you have 100 records and use a :limit of 10 and a :start of 10, you will get records 10-19. The maximum limit is 10000.
             :type limit: Integer

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` id

             :param sort: The data field(s) to use for sorting the output. Default is id. Valid values are id, datasource_id, timestamp, category, diagnostic, status, entry_type, visibility, message_code, message, silenceable_ind, silenced_ind, updated_at, subcategory.
             :type sort: Array of String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` asc

             :param dir: The direction(s) in which to sort the data. Default is 'asc'. Valid values are 'asc' and 'desc'.
             :type dir: Array of String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param select: The list of attributes to return for each SystemHealthSummary. Valid values are id, datasource_id, timestamp, category, diagnostic, status, entry_type, visibility, message_code, message, silenceable_ind, silenced_ind, updated_at, subcategory. If empty or omitted, all attributes will be returned.
             :type select: Array

            |  ``api version min:`` 2.8
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param goto_field: The field name for NIOS GOTO that is used for locating a row position of records.
             :type goto_field: String

            |  ``api version min:`` 2.8
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param goto_value: The value of goto_field for NIOS GOTO that is used for locating a row position of records.
             :type goto_value: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param query: This value will be matched against system health summaries, looking to see if one or more of the listed attributes contain the passed value. You may also surround the value with '/' and '/' to perform a regular expression search rather than a containment operation. Any record that matches will be returned. The attributes searched are: category, datasource_id, diagnostic, entry_type, id, message, message_code, silenceable_ind, silenced_ind, status, subcategory, timestamp, updated_at, visibility.
             :type query: String

            |  ``api version min:`` 2.3
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param xml_filter: A SetFilter XML structure to further refine the search. The SetFilter will be applied AFTER any search query or field values, but before any limit options. The limit and pagination will be enforced after the filter. Remind that this kind of filter may be costly and inefficient if not associated with a database filtering.
             :type xml_filter: String

            **Outputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return system_health_summaries: An array of the SystemHealthSummary objects that match the specified input criteria.
             :rtype system_health_summaries: Array of SystemHealthSummary

            """

        return self.api_list_request(self._get_method_fullname("search"), kwargs)

    def find(self, **kwargs):
        """Lists the available system health summaries matching the input specification. This provides the most flexible search specification of all the query mechanisms, enabling searching using comparison operations other than equality. However, it is more complex to use and will not perform as efficiently as the index or search methods. In the input descriptions below, 'field names' refers to the following fields: category, datasource_id, diagnostic, entry_type, id, message, message_code, silenceable_ind, silenced_ind, status, subcategory, timestamp, updated_at, visibility.

            **Inputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param op_category: The operator to apply to the field category. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. category: No description is available for category. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
             :type op_category: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_f_category: If op_category is specified, the field named in this input will be compared to the value in category using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_category must be specified if op_category is specified.
             :type val_f_category: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_c_category: If op_category is specified, this value will be compared to the value in category using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_category must be specified if op_category is specified.
             :type val_c_category: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param op_datasource_id: The operator to apply to the field datasource_id. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. datasource_id: No description is available for datasource_id. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
             :type op_datasource_id: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_f_datasource_id: If op_datasource_id is specified, the field named in this input will be compared to the value in datasource_id using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_datasource_id must be specified if op_datasource_id is specified.
             :type val_f_datasource_id: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_c_datasource_id: If op_datasource_id is specified, this value will be compared to the value in datasource_id using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_datasource_id must be specified if op_datasource_id is specified.
             :type val_c_datasource_id: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param op_diagnostic: The operator to apply to the field diagnostic. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. diagnostic: No description is available for diagnostic. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
             :type op_diagnostic: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_f_diagnostic: If op_diagnostic is specified, the field named in this input will be compared to the value in diagnostic using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_diagnostic must be specified if op_diagnostic is specified.
             :type val_f_diagnostic: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_c_diagnostic: If op_diagnostic is specified, this value will be compared to the value in diagnostic using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_diagnostic must be specified if op_diagnostic is specified.
             :type val_c_diagnostic: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param op_entry_type: The operator to apply to the field entry_type. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. entry_type: No description is available for entry_type. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
             :type op_entry_type: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_f_entry_type: If op_entry_type is specified, the field named in this input will be compared to the value in entry_type using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_entry_type must be specified if op_entry_type is specified.
             :type val_f_entry_type: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_c_entry_type: If op_entry_type is specified, this value will be compared to the value in entry_type using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_entry_type must be specified if op_entry_type is specified.
             :type val_c_entry_type: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param op_id: The operator to apply to the field id. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. id: No description is available for id. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
             :type op_id: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_f_id: If op_id is specified, the field named in this input will be compared to the value in id using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_id must be specified if op_id is specified.
             :type val_f_id: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_c_id: If op_id is specified, this value will be compared to the value in id using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_id must be specified if op_id is specified.
             :type val_c_id: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param op_message: The operator to apply to the field message. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. message: No description is available for message. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
             :type op_message: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_f_message: If op_message is specified, the field named in this input will be compared to the value in message using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_message must be specified if op_message is specified.
             :type val_f_message: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_c_message: If op_message is specified, this value will be compared to the value in message using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_message must be specified if op_message is specified.
             :type val_c_message: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param op_message_code: The operator to apply to the field message_code. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. message_code: No description is available for message_code. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
             :type op_message_code: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_f_message_code: If op_message_code is specified, the field named in this input will be compared to the value in message_code using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_message_code must be specified if op_message_code is specified.
             :type val_f_message_code: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_c_message_code: If op_message_code is specified, this value will be compared to the value in message_code using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_message_code must be specified if op_message_code is specified.
             :type val_c_message_code: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param op_silenceable_ind: The operator to apply to the field silenceable_ind. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. silenceable_ind: No description is available for silenceable_ind. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
             :type op_silenceable_ind: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_f_silenceable_ind: If op_silenceable_ind is specified, the field named in this input will be compared to the value in silenceable_ind using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_silenceable_ind must be specified if op_silenceable_ind is specified.
             :type val_f_silenceable_ind: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_c_silenceable_ind: If op_silenceable_ind is specified, this value will be compared to the value in silenceable_ind using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_silenceable_ind must be specified if op_silenceable_ind is specified.
             :type val_c_silenceable_ind: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param op_silenced_ind: The operator to apply to the field silenced_ind. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. silenced_ind: No description is available for silenced_ind. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
             :type op_silenced_ind: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_f_silenced_ind: If op_silenced_ind is specified, the field named in this input will be compared to the value in silenced_ind using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_silenced_ind must be specified if op_silenced_ind is specified.
             :type val_f_silenced_ind: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_c_silenced_ind: If op_silenced_ind is specified, this value will be compared to the value in silenced_ind using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_silenced_ind must be specified if op_silenced_ind is specified.
             :type val_c_silenced_ind: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param op_status: The operator to apply to the field status. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. status: No description is available for status. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
             :type op_status: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_f_status: If op_status is specified, the field named in this input will be compared to the value in status using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_status must be specified if op_status is specified.
             :type val_f_status: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_c_status: If op_status is specified, this value will be compared to the value in status using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_status must be specified if op_status is specified.
             :type val_c_status: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param op_subcategory: The operator to apply to the field subcategory. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. subcategory: No description is available for subcategory. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
             :type op_subcategory: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_f_subcategory: If op_subcategory is specified, the field named in this input will be compared to the value in subcategory using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_subcategory must be specified if op_subcategory is specified.
             :type val_f_subcategory: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_c_subcategory: If op_subcategory is specified, this value will be compared to the value in subcategory using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_subcategory must be specified if op_subcategory is specified.
             :type val_c_subcategory: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param op_timestamp: The operator to apply to the field timestamp. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. timestamp: No description is available for timestamp. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
             :type op_timestamp: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_f_timestamp: If op_timestamp is specified, the field named in this input will be compared to the value in timestamp using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_timestamp must be specified if op_timestamp is specified.
             :type val_f_timestamp: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_c_timestamp: If op_timestamp is specified, this value will be compared to the value in timestamp using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_timestamp must be specified if op_timestamp is specified.
             :type val_c_timestamp: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param op_updated_at: The operator to apply to the field updated_at. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. updated_at: No description is available for updated_at. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
             :type op_updated_at: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_f_updated_at: If op_updated_at is specified, the field named in this input will be compared to the value in updated_at using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_updated_at must be specified if op_updated_at is specified.
             :type val_f_updated_at: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_c_updated_at: If op_updated_at is specified, this value will be compared to the value in updated_at using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_updated_at must be specified if op_updated_at is specified.
             :type val_c_updated_at: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param op_visibility: The operator to apply to the field visibility. Valid values are: =, <>, rlike, not rlike, >, >=, <, <=, like, not like, is null, is not null, between. visibility: No description is available for visibility. For the between operator the value will be treated as an Array if comma delimited string is passed, and it must contain an even number of values.
             :type op_visibility: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_f_visibility: If op_visibility is specified, the field named in this input will be compared to the value in visibility using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either this field or val_c_visibility must be specified if op_visibility is specified.
             :type val_f_visibility: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param val_c_visibility: If op_visibility is specified, this value will be compared to the value in visibility using the specified operator. The value in this input will be treated as an explicit constant value. Either this field or val_f_visibility must be specified if op_visibility is specified.
             :type val_c_visibility: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param methods: A list of system health summary methods. The listed methods will be called on each system health summary returned and included in the output. Available methods are: data_source.
             :type methods: Array of String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param include: A list of associated object types to include in the output. The listed associations will be returned as outputs named according to the association name (see outputs below). Available includes are: data_source.
             :type include: Array of String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` 0

             :param start: The record number to return in the selected page of data. It will always appear, although it may not be the first record. See the :limit for more information.
             :type start: Integer

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` 1000

             :param limit: The size of the page of data, that is, the maximum number of records returned. The limit size will be used to break the data up into pages and the first page with the start record will be returned. So if you have 100 records and use a :limit of 10 and a :start of 10, you will get records 10-19. The maximum limit is 10000.
             :type limit: Integer

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` id

             :param sort: The data field(s) to use for sorting the output. Default is id. Valid values are id, datasource_id, timestamp, category, diagnostic, status, entry_type, visibility, message_code, message, silenceable_ind, silenced_ind, updated_at, subcategory.
             :type sort: Array of String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` asc

             :param dir: The direction(s) in which to sort the data. Default is 'asc'. Valid values are 'asc' and 'desc'.
             :type dir: Array of String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param select: The list of attributes to return for each SystemHealthSummary. Valid values are id, datasource_id, timestamp, category, diagnostic, status, entry_type, visibility, message_code, message, silenceable_ind, silenced_ind, updated_at, subcategory. If empty or omitted, all attributes will be returned.
             :type select: Array

            |  ``api version min:`` 2.8
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param goto_field: The field name for NIOS GOTO that is used for locating a row position of records.
             :type goto_field: String

            |  ``api version min:`` 2.8
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param goto_value: The value of goto_field for NIOS GOTO that is used for locating a row position of records.
             :type goto_value: String

            |  ``api version min:`` 2.3
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param xml_filter: A SetFilter XML structure to further refine the search. The SetFilter will be applied AFTER any search query or field values, but before any limit options. The limit and pagination will be enforced after the filter. Remind that this kind of filter may be costly and inefficient if not associated with a database filtering.
             :type xml_filter: String

            **Outputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return system_health_summaries: An array of the SystemHealthSummary objects that match the specified input criteria.
             :rtype system_health_summaries: Array of SystemHealthSummary

            """

        return self.api_list_request(self._get_method_fullname("find"), kwargs)

    def tree(self, **kwargs):
        """Get tree of health statuses

            **Inputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param query: Search string
             :type query: String

            **Outputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return actual_category: Actual category
             :rtype actual_category: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return category: Category name
             :rtype category: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return datasource_id: The internal identifier for this data source
             :rtype datasource_id: Integer

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return expanded: Expanded?
             :rtype expanded: Boolean

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return children: Array of available child objects
             :rtype children: Array

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return iconCls: Icon class name
             :rtype iconCls: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return leaf: Leaf?
             :rtype leaf: Boolean

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return updated_at: The date and time the record was last modified
             :rtype updated_at: DateTime

            """

        return self.api_request(self._get_method_fullname("tree"), kwargs)

    def storage_data(self, **kwargs):
        """Available disk space data for 2 last weeks

            **Inputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :param datasource_id: Datasource ID
             :type datasource_id: Integer

            **Outputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return name: Metric name
             :rtype name: String

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return value: Total amount of free bytes
             :rtype value: Integer

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return date: Timestamp
             :rtype date: DateTime

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return caption: Partition caption: OS Storage, Archive Storage, Database Storage, User Storage, Log Storage, Temporary Storage or Application Storage
             :rtype caption: String

            """

        return self.api_request(self._get_method_fullname("storage_data"), kwargs)

    def silence(self, **kwargs):
        """Silence/Unsilence warnings

            **Inputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` True
            |  ``default:`` None

             :param id: Id of warning
             :type id: Integer

            **Outputs**

            """

        return self.api_request(self._get_method_fullname("silence"), kwargs)

    def overall_system_health(self, **kwargs):
        """Delivers a one-line summary of system health.

            **Inputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` False

             :param include_silenced_ind: Indicates whether to include IDs that have been silenced by the user.
             :type include_silenced_ind: Boolean

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` False

             :param include_closed_ind: Indicates whether to include IDs that have been hidden for the user's session.
             :type include_closed_ind: Boolean

            **Outputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return critical_count: The total number of critical messages
             :rtype critical_count: Integer

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return warning_count: The total number of warning messages
             :rtype warning_count: Integer

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return offline_count: The total number of offline messages
             :rtype offline_count: Integer

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return rebooting_count: The total number of rebooting messages
             :rtype rebooting_count: Integer

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return ok_count: The total number of OK messages
             :rtype ok_count: Integer

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return health_status_outdated: Is health status outdated?
             :rtype health_status_outdated: Boolean

            """

        return self.api_request(self._get_method_fullname("overall_system_health"), kwargs)

    def hide_overall_system_health_bar(self, **kwargs):
        """Hides the system health status bar for the current unhealthy IDs.

            **Inputs**

            **Outputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return layout: Always returns false
             :rtype layout: Boolean

            """

        return self.api_request(self._get_method_fullname("hide_overall_system_health_bar"), kwargs)

    def license_issue_summary(self, **kwargs):
        """Delivers a one-line summary of platform limit issues.

            **Inputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` False

             :param include_closed_ind: Indicates whether to include IDs that have been hidden for the user's session.
             :type include_closed_ind: Boolean

            **Outputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return health_status_outdated: Is health status outdated?
             :rtype health_status_outdated: Boolean

            """

        return self.api_request(self._get_method_fullname("license_issue_summary"), kwargs)

    def hide_license_issue_bar(self, **kwargs):
        """Hides the platform limit issue bar for the current issue IDs.

            **Inputs**

            **Outputs**

            |  ``api version min:`` None
            |  ``api version max:`` None
            |  ``required:`` False
            |  ``default:`` None

             :return layout: Always returns false
             :rtype layout: Boolean

            """

        return self.api_request(self._get_method_fullname("hide_license_issue_bar"), kwargs)


text:
package com.wakeup.qcloud.request;

import static com.google.common.collect.Maps.newHashMap;

import java.util.Map;
import java.util.Set;

import com.wakeup.qcloud.response.GetRoleInGroupResponse;

/**
 * 查询用户在群组中的身份 https://www.qcloud.com/document/product/269/1626
 *
 * @since 2017年3月5日
 * @author kalman03O
 */
public class GetRoleInGroupRequest extends
		AbstractQCloudIMRequest<GetRoleInGroupResponse> {

	private static final long serialVersionUID = 9197076482321160595L;
	/**
	 * 必填 需要查询的群组ID。
	 */
	private String groupId;
	/**
	 * 必填 表示需要查询的用户账号,最多支持500个账号。
	 */
	private Set<String> userAccounts;

	@Override
	public Map<String, Object> getTextParams() {
		Map<String, Object> map = newHashMap();
		map.put("GroupId", groupId);
		map.put("User_Account", userAccounts);
		return map;
	}

	@Override
	public Class<GetRoleInGroupResponse> getResponseClass() {
		return GetRoleInGroupResponse.class;
	}

	@Override
	public String getApiName() {
		return "group_open_http_svc/get_role_in_group";
	}

	public String getGroupId() {
		return groupId;
	}

	public void setGroupId(String groupId) {
		this.groupId = groupId;
	}

	public Set<String> getUserAccounts() {
		return userAccounts;
	}

	public void setUserAccounts(Set<String> userAccounts) {
		this.userAccounts = userAccounts;
	}

}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "authors".
 *
 * @property integer $id
 * @property string $firstname
 * @property string $lastname
 *
 * @property Books[] $books
 */
class Authors extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'authors';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['firstname', 'lastname'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'firstname' => 'Имя',
            'lastname' => 'Фамилия',
            'FullName' => 'Автор'
        ];
    }

    public function getFullName()
    {
        return $this->firstname.' '.$this->lastname;
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getBooks()
    {
        return $this->hasMany(Books::className(), ['author_id' => 'id']);
    }
}


text:
static const CGFloat LOActivityBezelLabelMargin = 20.f;
static const CGFloat LOActivityBezelLabelHeight = 20.f;

@interface LOActivityBezelViewController : UIViewController
@property (nonatomic, assign) UIStatusBarStyle statusBarStyle;
- (void)setMessage:(NSString *)message;
@end

@implementation LOActivityBezelViewController

- (void)loadView
{
    CGSize screenSize = [UIScreen mainScreen].bounds.size;
    UIView *v = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    v.backgroundColor = [UIColor clearColor];
    self.view = v;

    CGSize bezelSize = CGSizeMake(160.f, 160.f);
    CGRect frame = CGRectMake((screenSize.width - bezelSize.width)/2.f, (screenSize.height - bezelSize.height)/2.f, bezelSize.width, bezelSize.height);
    UIView *bg = [[UIView alloc] initWithFrame:frame];
    bg.backgroundColor = [UIColor colorWithWhite:0.f alpha:0.75f];
    bg.layer.cornerRadius = 20.0f;
    bg.tag = 1;
    [v addSubview:bg];

    UIActivityIndicatorView *activityIndicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
    CGRect bezelBounds = bg.bounds;
    activityIndicator.center = CGPointMake(bezelBounds.size.width/2.f, bezelBounds.size.height/2.f);
    [activityIndicator startAnimating];
    [bg addSubview:activityIndicator];

    CGRect labelRect = CGRectMake(LOActivityBezelLabelMargin, bezelBounds.size.height-LOActivityBezelLabelMargin-LOActivityBezelLabelHeight,
                                  bezelBounds.size.width-LOActivityBezelLabelMargin*2, LOActivityBezelLabelHeight);
    UILabel *label = [[UILabel alloc] initWithFrame:labelRect];
    [label setTextColor:[UIColor lightTextColor]];
    [label setFont:[UIFont systemFontOfSize:[UIFont labelFontSize]-2.f]];
    [label setTextAlignment:NSTextAlignmentCenter];
    [label setBackgroundColor:[UIColor clearColor]];
    label.tag = 0xBEEF;
    [bg addSubview:label];
}

- (void)setMessage:(NSString *)message
{
    UILabel *label = (UILabel *)[self.view viewWithTag:0xBEEF];
    label.text = message;
    label.hidden = (message == nil);
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
    return UIInterfaceOrientationIsPortrait(toInterfaceOrientation);
}

- (BOOL)shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown;
}

- (UIStatusBarStyle)preferredStatusBarStyle
{
    return _statusBarStyle;
}

@end

@interface LOActivityBezel ()
@property (nonatomic, strong) UIWindow *window;
@property (nonatomic, assign) BOOL presented;
@end

@implementation LOActivityBezel

- (id)init
{
    self = [super init];
    return self;
}

#pragma mark -
#pragma mark instance methods

- (void)present
{
    [self presentWithMessage:nil];
}

- (void)presentWithMessage:(NSString *)message
{
    _presented = YES;

    LOActivityBezelViewController *vc;
    if (_window == nil) {
        _window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
        vc = [[LOActivityBezelViewController alloc] init];
        _window.rootViewController = vc;
    } else {
        vc = (LOActivityBezelViewController *)_window.rootViewController;
        [vc.view.layer removeAllAnimations];
    }
    [vc setMessage:message];

    // get the current status bar style
    UIStatusBarStyle sbs = [UIApplication sharedApplication].statusBarStyle;
    UIViewController *currentRoot = [UIApplication sharedApplication].keyWindow.rootViewController;
    if ([currentRoot respondsToSelector:@selector(preferredStatusBarStyle)]) {
        sbs = currentRoot.preferredStatusBarStyle;
    }
    vc.statusBarStyle = sbs;

    _window.windowLevel = 1.f;
    _window.opaque = NO;
    _window.hidden = NO;
    _window.rootViewController.view.alpha = 1.f;
}

- (void)dismiss
{
    _presented = NO;
    [UIView animateWithDuration:0.25f
                     animations:^{
                         self.window.rootViewController.view.alpha = 0.0f;
                     }
                     completion:^(BOOL finished) {
                         if (!_presented) {
                             self.window.hidden = YES;
                             self.window = nil;
                         }
                     }];
}

#pragma mark -
#pragma mark Singleton methods

+ (id)sharedBezel
{
    static id sharedInstance;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        sharedInstance = [[self alloc] init];
    });
    return sharedInstance;
}

@end


text:
package sk.tuke.gamedev.iddqd.tukequest.visual;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.ProgressBar;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import sk.tuke.gamedev.iddqd.tukequest.TukeQuestGame;

/**
 * Created by Steve on 29.04.2017.
 */
public abstract class AbstractProgressBar {

    public enum Type {
        Vertical, Horizontal
    }

    public static final int BAR_WIDTH = 15;
    public static final int VALUE_WIDTH = 45;

    protected int maxValue;
    protected com.badlogic.gdx.scenes.scene2d.ui.ProgressBar bar;

    public AbstractProgressBar(int maxValue, Type type, Color fullColor, Color fullBack, Color emptyColor, Color emptyBack) {
        this.maxValue = maxValue;
        int valueWidth = type == Type.Horizontal ? VALUE_WIDTH : BAR_WIDTH;
        int valueHeight = type == Type.Horizontal ? BAR_WIDTH : VALUE_WIDTH;
        Pixmap fullMap = new Pixmap(valueWidth, valueHeight, Pixmap.Format.RGBA8888);
        fullMap.setColor(fullColor);
        fullMap.fill();
        Pixmap emptyMap = new Pixmap(valueWidth, valueHeight, Pixmap.Format.RGBA8888);
        emptyMap.setColor(emptyColor);
        emptyMap.fill();

        Skin skin = new Skin();
        skin.add("full", new Texture(fullMap));
        skin.add("empty", new Texture(emptyMap));

        ProgressBar.ProgressBarStyle barStyle = new ProgressBar.ProgressBarStyle(
            skin.newDrawable("empty", emptyBack),
            skin.newDrawable("full", fullBack));
        this.bar = new ProgressBar(0, maxValue, 0.1f, type == Type.Vertical, barStyle);

        // By default it goes over the entire screen width or height
        switch (type) {
            case Vertical:
                // Will start right above Horizontal Progress Bar
                setSize(bar.getPrefWidth(), TukeQuestGame.SCREEN_HEIGHT - bar.getPrefWidth());
                setPosition(TukeQuestGame.SCREEN_WIDTH - bar.getPrefWidth(), bar.getPrefWidth());
                break;
            case Horizontal:
                setSize(TukeQuestGame.SCREEN_WIDTH, bar.getPrefHeight());
                break;
            default:
                // Assertion to prevent unhandled state in the future
                throw new IllegalArgumentException("Unexpected Progress Bar type");
        }
        //bar.setAnimateDuration(1);
    }

    public AbstractProgressBar addToStage(Stage stage) {
        stage.addActor(this.bar);
        return this;
    }

    public void setPosition(float x, float y) {
        this.bar.setPosition(x, y);
    }

    public void setSize(float width, float height) {
        this.bar.setSize(width, height);
    }

    public int getMaxValue() {
        return this.maxValue;
    }

    public void setValue(float value) {
        this.bar.setValue(value);
    }

}


text:
  JSAN.addRepository('../lib').use('Test.Builder');
  var test = new Test.Builder;
  if (Test.PLATFORM == 'director')
      test.plan({ skipAll: "JSAN not yet supporting Director" });
  else test.plan({ tests: 11 });
  var jsan = new JSAN;
  test.ok(jsan, "Instantiated JSAN object");
  test.ok(typeof Test.Simple == 'undefined',
          "Test.Simple should not yet be loaded");
  test.ok(typeof ok == 'undefined', "There should be no global ok");
  jsan.use('Test.Simple');
  test.ok(typeof Test.Simple != 'undefined',
          "Test.Simple should now be loaded");
  test.ok(typeof ok != 'undefined', "There should be now be a global ok");
  test.ok(ok == Test.Simple.ok,
          "The global ok should be the same as Test.Simple.ok");
  test.ok(plan == Test.Simple.plan,
          "The global plan should be the same as Test.Simple.plan");
  test.ok(typeof Test.More == 'undefined',
          "Test.More should not yet be loaded");
  test.ok(typeof isa == 'undefined', "There should be no global isa");
  jsan.use('Test.More');
  test.ok(typeof Test.More != 'undefined',
          "Test.More should now be loaded");
  test.ok(typeof isa != 'undefined', "There should now be a global isa");


text:
require 'spec_helper'

describe 'Levelup::Endpoints::UserOrders', :vcr => true do
  describe '#list' do
    it 'returns a user\'s order history' do
      response = @test_client.users.orders.list(TestConfig.user_token_with_read_orders_perms)
      (response).should be_success
      (response.orders).should_not be_nil
    end
  end
end


text:
using System;
using System.Diagnostics.Contracts;
using System.IO;
using System.Linq;
using System.Text;

namespace Bari.Core.Generic
{
    /// <summary>
    /// Extension methods for the <see cref="IFileSystemDirectory"/> interface
    /// </summary>
    public static class FileSystemDirectoryExtensions
    {
        /// <summary>
        /// Gets a child directory and optionally creates it if missing
        /// </summary>
        /// <param name="root">The root directory</param>
        /// <param name="childName">The name of the direct child directory</param>
        /// <param name="createIfMissing">If <c>true</c>, the child directory will be created if does not exist</param>
        /// <exception cref="ArgumentException">Thrown if the child directory does not exist and <c>createIfMissing</c> parameter is false</exception>
        /// <returns>Returns the file system abstraction of the child directory</returns>
        public static IFileSystemDirectory GetChildDirectory(this IFileSystemDirectory root, string childName, bool createIfMissing)
        {
            Contract.Requires(root != null);
            Contract.Requires(!String.IsNullOrWhiteSpace(childName));
            Contract.Ensures(Contract.Result<IFileSystemDirectory>() != null);

            if (root.ChildDirectories.Any(name => name.Equals(childName, StringComparison.InvariantCultureIgnoreCase)))
            {
                return root.GetChildDirectory(childName);
            }
            else
            {
                if (createIfMissing)
                    return root.CreateDirectory(childName);
                else
                    throw new ArgumentException("The argument is not a child directory of this directory", "childName");
            }
        }

        /// <summary>
        /// Creates a binary file in the given directory, or in a subdirectory of it.
        /// If the subdirectory does not exist, it will be created.
        /// </summary>
        /// <param name="root">The root directory</param>
        /// <param name="relativePath">Relative path of the file to be created</param>
        /// <returns>Returns the stream for writing the binary file.</returns>
        public static Stream CreateBinaryFileWithDirectories(this IFileSystemDirectory root, string relativePath)
        {
            Contract.Requires(root != null);
            Contract.Requires(!String.IsNullOrWhiteSpace(relativePath));

            string dirName = Path.GetDirectoryName(relativePath);
            if (!String.IsNullOrWhiteSpace(dirName))
            {
                var subdir = root.GetChildDirectory(dirName, createIfMissing: true);
                return subdir.CreateBinaryFile(Path.GetFileName(relativePath));
            }
            else
            {
                return root.CreateBinaryFile(relativePath);
            }
        }

        /// <summary>
        /// Gets the relative path from a given directory to given file in a larger common directory subtree.
        ///
        /// r.Object.GetRelativePathFrom(a.Object, @"a\c.txt").Should().Be(@"c.txt");
        /// r.Object.GetRelativePathFrom(a.Object, @"a.test\e.txt").Should().Be(@"..\a.test\e.txt");
        /// r.Object.GetRelativePathFrom(a.Object, @"b\d.txt").Should().Be(@"..\b\d.txt");
        /// </summary>
        /// <example>
        /// Consider the following hierarchy:
        /// r
        /// -> a
        ///   -> c.txt
        /// -> a.test
        ///   -> e.txt
        /// -> b
        ///   -> d.txt
        ///
        /// In this case:
        /// <c>r.GetRelativePathFrom(a, "a\c.txt")</c> is <c>c.txt</c>
        /// <c>r.GetRelativePathFrom(a, "a.test\e.txt")</c> is <c>..\a.test\e.txt</c>
        /// <c>r.GetRelativePathFrom(a, "b\d.txt")</c> is <c>..\b\d.txt</c>
        /// </example>
        /// <param name="root">The directory subtree which contains both <c>innerRoot</c> and <c>outerRelativePath</c></param>
        /// <param name="innerRoot">The directory to get the path relative to</param>
        /// <param name="outerRelativePath">The target path, relative to the <c>root</c> directory</param>
        /// <returns>Returns the relative path from <c>innerRoot</c> to <c>outerRelativePath</c> (which is specified as a relative path
        /// to <c>root</c>)</returns>
        public static string GetRelativePathFrom(this IFileSystemDirectory root, IFileSystemDirectory innerRoot, string outerRelativePath)
        {
            if (root == innerRoot)
                return outerRelativePath;
            else
            {
                string innerFromOuter = root.GetRelativePath(innerRoot);
                if (outerRelativePath.StartsWith(innerFromOuter + Path.DirectorySeparatorChar, StringComparison.InvariantCultureIgnoreCase))
                    return outerRelativePath.Substring(innerFromOuter.Length).TrimStart(Path.DirectorySeparatorChar);
                else
                {
                    string prefix = String.Join(Path.DirectorySeparatorChar.ToString(), innerFromOuter.Split(Path.DirectorySeparatorChar).Select(_ => ".."));
                    return Path.Combine(prefix, outerRelativePath);
                }
            }
        }
    }
}


text:
<?php

// Don't forget to rename creds-dist.php to creds.php and insert your API key
require __DIR__.'/creds.php';
require __DIR__.'/../vendor/autoload.php';

$bundle = new \Clarify\Bundle($apikey);

$results = $bundle->index();
$items = $results['_links']['items'];

foreach ($items as $item) {
    $bundle = $bundle->load($item['href']);

    $id = $bundle['_links']['self']['href'];
    echo $id . "\n";
    echo $bundle['name'] . "\n";

    $version = $bundle['version'];
    $success = $bundle->update($id, 'updated-name-' . rand(0,500), '', $version);

    if ($success) {
        $bundle = $bundle->load($item['href']);
        $id = $bundle['_links']['self']['href'];
        echo $id . "\n";
        echo $bundle['name'] . "\n";
    } else {
        echo "Nope, it didn't update \n";
    }
}


text:
from django import forms
from django.conf import settings
from django.utils.translation import get_language_bidi

__all__ = ['ChosenWidgetMixin', 'ChosenSelect', 'ChosenSelectMultiple',
           'ChosenGroupSelect']

class ChosenWidgetMixin(object):
    class Media:
        js = ("%s%s?v=2" % (settings.STATIC_URL, "js/chosen.jquery.min.js"),
              "%s%s?v=4" % (settings.STATIC_URL, "js/chosen.jquery_ready.js"))
        css = {"all": ("%s%s?v=1" % (settings.STATIC_URL, "css/chosen.css"), )}

    def __init__(self, attrs={}, *args, **kwargs):
        attrs['data-placeholder'] = kwargs.pop('overlay', None)

        attrs['class'] = "class" in attrs and self.add_to_css_class(
            attrs['class'], 'chzn-select') or "chzn-select"

        if get_language_bidi():
            attrs['class'] = self.add_to_css_class(attrs['class'], 'chzn-rtl')

        super(ChosenWidgetMixin, self).__init__(attrs, *args, **kwargs)

    def render(self, *args, **kwargs):
        if not self.is_required:
            self.attrs.update({'data-optional': True})
        return super(ChosenWidgetMixin, self).render(*args, **kwargs)

    def add_to_css_class(self, classes, new_class):
        new_classes = classes
        try:
            classes_test = " " + classes + " "
            new_class_test = " " + new_class + " "
            if new_class_test not in classes_test:
                new_classes += " " + new_class
        except TypeError:
            pass
        return new_classes

class ChosenSelect(ChosenWidgetMixin, forms.Select):
    pass

class ChosenSelectMultiple(ChosenWidgetMixin, forms.SelectMultiple):
    pass

class ChosenGroupSelect(ChosenSelect):

    def __init__(self, attrs={}, *args, **kwargs):
        super(ChosenGroupSelect, self).__init__(attrs, *args, **kwargs)
        attrs["class"] = "chzn-single chzn-single-with-drop"


text:
<?php
namespace DogtorVet\Backend\Rest;

use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use PsrJwt\Factory\Jwt;
use PDOException;
use PDO;

use DogtorVet\Backend\Util\Config;
use DogtorVet\Backend\Util\DataSource;
use DogtorVet\Backend\Modelos\Usuario;

class LoginController {

    public function login(Request $req, Response $res, array $args ): Response {
        try {
            $credenciales = json_decode( $req->getBody(), true );
            $config = Config::obtenerInstancia();
            $conexion = DataSource::abrirConexion();
            $sentencia = $conexion->prepare(Usuario::SQL_SELECT_LOGIN);
            $sentencia->bindParam(1, $credenciales['username']);
            $sentencia->bindParam(2, $credenciales['password']);
            $sentencia->execute();
            $resultset = $sentencia->fetch();
            if( $resultset ) {
                $factory = new Jwt();
                $builder = $factory->builder();
                $token = $builder->setSecret( $config->jwtSecret() )
                    ->setPayloadClaim('username', $credenciales['username'])
                    ->setExpiration( time() + (3600 *2) )
                    ->build();
                $res->getBody()->write( json_encode( ['token' => $token->getToken()] ) );
                return $res->withHeader( 'Content-Type', 'application/json' )->withStatus(200);
            }
            $mensaje['codigo'] = 'error';
            $mensaje['mensaje'] = 'Login inválido';
            $res->getBody()->write( json_encode( $mensaje ) );
            return $res->withHeader( 'Content-Type', 'application/json' )->withStatus(401);
        } catch(PDOException $e) {
            $mensaje['codigo'] = "Error {$e->getCode()}";
            $mensaje['mensaje'] = $e->getMessage();
            $res->getBody()->write( json_encode( $mensaje ) );
            return $res->withHeader( 'Content-Type', 'application/json' )->withStatus(500);
        }
    }

}

?>


text:
package org.projog.core.predicate.udp;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.projog.TermFactory.atom;
import static org.projog.TermFactory.structure;

import org.junit.Before;
import org.junit.Test;
import org.projog.SimpleProjogListener;
import org.projog.TestUtils;
import org.projog.core.kb.KnowledgeBase;
import org.projog.core.predicate.Predicate;
import org.projog.core.predicate.PredicateFactory;
import org.projog.core.predicate.PredicateKey;
import org.projog.core.predicate.SucceedsNeverPredicate;
import org.projog.core.predicate.SucceedsOncePredicate;
import org.projog.core.predicate.udp.ClauseModel;
import org.projog.core.predicate.udp.InterpretedUserDefinedPredicate;
import org.projog.core.predicate.udp.StaticUserDefinedPredicateFactory;
import org.projog.core.term.Term;

public class MultipleRulesWithSingleImmutableArgumentPredicateTest {
   private static final String FUNCTOR = "test";

   private KnowledgeBase kb;
   private PredicateFactory testObject;

   @Before
   public void init() {
      String[] atomNames = {"a", "b", "c", "c", "c", "c", "c", "d", "e", "b", "f"};

      kb = TestUtils.createKnowledgeBase(TestUtils.PROJOG_DEFAULT_PROPERTIES);
      PredicateKey key = new PredicateKey(FUNCTOR, 1);
      StaticUserDefinedPredicateFactory pf = new StaticUserDefinedPredicateFactory(kb, key);
      for (String atomName : atomNames) {
         ClauseModel clause = ClauseModel.createClauseModel(structure(FUNCTOR, atom(atomName)));
         pf.addLast(clause);
      }
      kb.getPredicates().addUserDefinedPredicate(pf);
      assertSame(pf, kb.getPredicates().getPredicateFactory(key));
      testObject = pf.getActualPredicateFactory();
   }

   @Test
   public void testSuceedsNever() {
      assertSame(SucceedsNeverPredicate.SINGLETON, testObject.getPredicate(new Term[] {atom("z")}));
   }

   @Test
   public void testSucceedsOnce() {
      assertSame(SucceedsOncePredicate.SINGLETON, testObject.getPredicate(new Term[] {atom("a")}));
      assertSame(SucceedsOncePredicate.SINGLETON, testObject.getPredicate(new Term[] {atom("d")}));
      assertSame(SucceedsOncePredicate.SINGLETON, testObject.getPredicate(new Term[] {atom("e")}));
      assertSame(SucceedsOncePredicate.SINGLETON, testObject.getPredicate(new Term[] {atom("f")}));
   }

   @Test
   public void testSucceedsMany() {
      assertSucceedsMany(atom("b"), 2);
      assertSucceedsMany(atom("c"), 5);
      assertNotSame(testObject.getPredicate(new Term[] {atom("b")}), testObject.getPredicate(new Term[] {atom("b")}));
   }

   private void assertSucceedsMany(Term arg, int expectedSuccesses) {
      Predicate p = testObject.getPredicate(new Term[] {arg});
      assertSame(InterpretedUserDefinedPredicate.class, p.getClass()); // TODO add assertClass to TestUtils
      for (int i = 0; i < expectedSuccesses; i++) {
         assertTrue(p.couldReevaluationSucceed());
         assertTrue(p.evaluate());
      }
      assertFalse(p.evaluate());
   }

   @Test
   public void testSpyPointEnabled_fails() {
      final SimpleProjogListener o = new SimpleProjogListener();
      kb.getProjogListeners().addListener(o);

      kb.getSpyPoints().setTraceEnabled(true);

      Predicate p = testObject.getPredicate(new Term[] {atom("z")});
      assertFalse(p.evaluate());
      assertSame(SucceedsNeverPredicate.class, p.getClass());
      assertEquals("CALLtest(z)FAILtest(z)", o.result());
   }

   @Test
   public void testSpyPointEnabled_succeedsOnce() {
      final SimpleProjogListener o = new SimpleProjogListener();
      kb.getProjogListeners().addListener(o);

      kb.getSpyPoints().setTraceEnabled(true);

      Predicate p = testObject.getPredicate(new Term[] {atom("a")});
      assertTrue(p.evaluate());
      assertFalse(p.couldReevaluationSucceed());
      assertSame(SucceedsOncePredicate.class, p.getClass());
      assertEquals("CALLtest(a)EXITtest(a)", o.result());
   }

   @Test
   public void testSpyPointEnabled_succeedsMany() {
      final SimpleProjogListener o = new SimpleProjogListener();
      kb.getProjogListeners().addListener(o);

      kb.getSpyPoints().setTraceEnabled(true);

      Predicate p = testObject.getPredicate(new Term[] {atom("c")});
      assertTrue(p.evaluate());
      assertTrue(p.couldReevaluationSucceed());
      assertTrue(p.evaluate());
      assertTrue(p.couldReevaluationSucceed());
      assertTrue(p.evaluate());
      assertTrue(p.couldReevaluationSucceed());
      assertTrue(p.evaluate());
      assertTrue(p.couldReevaluationSucceed());
      assertTrue(p.evaluate());
      assertFalse(p.couldReevaluationSucceed());
      assertSame(InterpretedUserDefinedPredicate.class, p.getClass());
      assertEquals("CALLtest(c)EXITtest(c)REDOtest(c)EXITtest(c)REDOtest(c)EXITtest(c)REDOtest(c)EXITtest(c)REDOtest(c)EXITtest(c)", o.result());
   }
}


text:
SX1273::SX1273(Module* mod) : SX1272(mod) {

}

int16_t SX1273::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t power, uint8_t currentLimit, uint16_t preambleLength, uint8_t gain) {
  // execute common part
  int16_t state = SX127x::begin(SX1272_CHIP_VERSION, syncWord, currentLimit, preambleLength);
  if(state != ERR_NONE) {
    return(state);
  }

  // configure settings not accessible by API
  state = config();
  if(state != ERR_NONE) {
    return(state);
  }

  // mitigation of receiver spurious response
  // see SX1272/73 Errata, section 2.2 for details
  state = _mod->SPIsetRegValue(0x31, 0b10000000, 7, 7);
  if(state != ERR_NONE) {
    return(state);
  }

  // configure publicly accessible settings
  state = setFrequency(freq);
  if(state != ERR_NONE) {
    return(state);
  }

  state = setBandwidth(bw);
  if(state != ERR_NONE) {
    return(state);
  }

  state = setSpreadingFactor(sf);
  if(state != ERR_NONE) {
    return(state);
  }

  state = setCodingRate(cr);
  if(state != ERR_NONE) {
    return(state);
  }

  state = setOutputPower(power);
  if(state != ERR_NONE) {
    return(state);
  }

  state = setGain(gain);
  if(state != ERR_NONE) {
    return(state);
  }

  return(state);
}

int16_t SX1273::setSpreadingFactor(uint8_t sf) {
  uint8_t newSpreadingFactor;

  // check allowed spreading factor values
  switch(sf) {
    case 6:
      newSpreadingFactor = SX127X_SF_6;
      break;
    case 7:
      newSpreadingFactor = SX127X_SF_7;
      break;
    case 8:
      newSpreadingFactor = SX127X_SF_8;
      break;
    case 9:
      newSpreadingFactor = SX127X_SF_9;
      break;
    default:
      return(ERR_INVALID_SPREADING_FACTOR);
  }

  // set spreading factor and if successful, save the new setting
  int16_t state = setSpreadingFactorRaw(newSpreadingFactor);
  if(state == ERR_NONE) {
    SX127x::_sf = sf;
  }

  return(state);
}


text:
This is primarily a toy project to teach myself about React and Redux. The outcome will be a simple single page web app that enables Australian citizens to request data held about them under the Australian Privacy Act by the Australian federal Police.

[![Build Status](https://travis-ci.org/davesag/apa-data-requester.svg?branch=master)](https://travis-ci.org/davesag/apa-data-requester)

See [the corresponding client project](https://github.com/davesag/apa-data-requester-client).

## Background

The [Australian Privacy Act](https://www.oaic.gov.au/privacy-law/privacy-act/) allows Australian citizens to access personal information held about themselves by Australian companies and government agencies including the Australian Federal Police. You can request documents such as criminal records, investigation records and other data (with a few exceptions). To access these documents you simply lodge a `Privacy Request` with the Australian Federal Police. This can be done by emailing [privacy@afp.gov.au](mailto:privacy@afp.gov.au) with the following information:

* Your full name
* Date of birth
* Current residential address
* Contact details, such as email or phone number,
* Details as to the information you are seeking
* Some valid photo ID

If you are a journalist, you could supply the following wording:

"Under the terms of the Australian Privacy Act, I request access to all documents held by the AFP mentioning my name related to referrals to the AFP for investigation regarding leaks to me in my capacity as a journalist for [publication name]."

If you are not a journalist you could use this wording instead:

"Under the terms of the Australian Privacy Act, I request access to all documents held by the AFP mentioning my name, created between [date] and [date]."

The AFP then has 30 days to respond. It has internal access to a simple to use name search database and is able to pull up records by name if asked. If you are not satisfied with the response you get, or you don't think the AFP handed over all the information you believe they have that concerns you, then you can file a privacy complaint, and the Privacy Commissioner can consider whether to investigate the matter. The filing of these subsequent complaints is out of scope for this project however.

### Links

* http://www.crikey.com.au/2016/04/15/how-to-know-if-the-afp-is-spying-on-you-or-your-sources/ (My inspiration for this project)
* http://www.theguardian.com/media/2016/feb/12/the-afp-and-me-how-one-of-my-asylum-stories-sparked-a-200-page-police-investigation
* http://www.theguardian.com/world/2016/apr/14/federal-police-admit-seeking-access-to-reporters-metadata-without-warrant

# Development

This is, at heart, a toy project, whose aim is to teach myself to use Redux and React in a non-trivial way.

## Pre-requisites

* [NodeJS 6.5.0] or better. `brew install node` or even better use [NVM](https://github.com/creationix/nvm) and `nvm install 6.5.0`

Run `npm install` to install all the dependencies.

## To test

Both the unit and the integration tests

```sh
npm run test:all
```

Just the unit tests

```sh
npm test
```

just the integration tests

```sh
npm run test:integration
```

## To debug

You can [debug NodeJS apps using Chrome](http://blog.andrewray.me/how-to-debug-mocha-tests-with-chrome/).

### Setup

* Install [node-inspector] via `npm install -g node-inspector`.

### Then to do the debugging

* open a new tab in your terminal and run `node-inspector`
* in your original terminal run `npm run test:debug`
* open Chrome and point it at https://localhost:8080/debug?port=5858


text:
class AddShownInIrcToLogs < ActiveRecord::Migration[5.0]
  def change
    add_column :logs, :shown_in_irc, :boolean, default: false
    add_column :logs, :command, :string
  end
end


text:
Here is a list of resources that have changed behavior between v1.x and 2.x

### aptly_mirror

aptly_mirror resource **architectures** property has changed in a way that it now requires a array instead of a string.

### aptly_publish

aptly_publish Resource **architectures** property no longer explicitly defaults to `['amd64']` thus no longer always overriding the global aptly configuration/cookbook attribute value of `default['aptly']['architectures']`. This mimics aptly's native behavior.


text:
.noty_theme__bootstrap-v3.noty_bar {
  margin: 4px 0;
  overflow: hidden;
  position: relative;
  border: 1px solid transparent;
  border-radius: 4px; }
  .noty_theme__bootstrap-v3.noty_bar .noty_body {
    padding: 15px; }
  .noty_theme__bootstrap-v3.noty_bar .noty_buttons {
    padding: 10px; }
  .noty_theme__bootstrap-v3.noty_bar .noty_close_button {
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    filter: alpha(opacity=20);
    opacity: .2;
    background: transparent; }
  .noty_theme__bootstrap-v3.noty_bar .noty_close_button:hover {
    background: transparent;
    text-decoration: none;
    cursor: pointer;
    filter: alpha(opacity=50);
    opacity: .5; }

.noty_theme__bootstrap-v3.noty_type__alert,
.noty_theme__bootstrap-v3.noty_type__notification {
  background-color: #fff;
  color: inherit; }

.noty_theme__bootstrap-v3.noty_type__warning {
  background-color: #fcf8e3;
  color: #8a6d3b;
  border-color: #faebcc; }

.noty_theme__bootstrap-v3.noty_type__error {
  background-color: #f2dede;
  color: #a94442;
  border-color: #ebccd1; }

.noty_theme__bootstrap-v3.noty_type__info,
.noty_theme__bootstrap-v3.noty_type__information {
  background-color: #d9edf7;
  color: #31708f;
  border-color: #bce8f1; }

.noty_theme__bootstrap-v3.noty_type__success {
  background-color: #dff0d8;
  color: #3c763d;
  border-color: #d6e9c6; }


text:
layout: page
title: "Ruby Profiling"
date:  2018-09-11 21:27:00
---

### Tools

- [Stackprof](https://github.com/tmm1/stackprof),
  a sampling call stack profiler.
- [Allocation tracer](https://github.com/ko1/allocation_tracer)

### Videos

- [How to Performance](https://www.youtube.com/watch?v=obyrJ_aJU6A):
  talk by Eileen Uchitelle about benchmarking and profiling Ruby.
  Covers Rubyprof, Stackprof, allocation tracer, etc.


text:
var argv = require('optimist').argv;
var prompt = require('prompt');
var Cassandra = require('cassandra-driver');

argv.host = argv.host || 'localhost';
argv.port = parseInt(argv.port || '9042');

var client = new Cassandra.Client({
  contactPoints: [argv.host],
  protocolOptions: {
    port: argv.port
  }
});

prompt.message = '';
prompt.delimiter = '';

function doPrompt() {
  prompt.get(['cql'], function(err, result) {
    if (result.cql.trim().toLowerCase() === 'exit') {
      return process.exit(1);
    }

    client.execute(result.cql, function(err, data) {
      if (err) {
        console.error(err);
      } else {
        console.log(JSON.stringify(data, null, 2));
      }

      doPrompt();
    });
  });
}

doPrompt();


text:
<?php

namespace VinC2C\LandingPageBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class VinC2CLandingPageBundle extends Bundle
{
}


text:
<?php
    require '../../re-use/head.php';
?>

                        Producto

 Home

Modificar Producto

                                <form role="form">

                                        Codigo
                                        <input type="text" class="form-control" placeholder="Ingrese el Codigo"/>

                                        Nombre
                                        <input type="text" class="form-control" placeholder="Ingrese el nombre"/>

                                        Proveedor
                                        <select class="form-control">
                                            <option>proveedor 1</option>
                                            <option>proveedor 2</option>
                                            <option>proveedor 3</option>
                                        </select>

                                        Categorias
                                        <select class="form-control">
                                            <option>Categoria 1</option>
                                            <option>Categoria 2</option>
                                            <option>Categoria 3</option>
                                        </select>

                                </form>

                                    Stock minimo
                                    <input type="text" class="form-control" placeholder="Ingrese el Stock minimo"/>

                                    Stock maximo
                                    <input type="text" class="form-control" placeholder="Ingrese el Stock maximo"/>

                                    Bodega
                                    <select class="form-control">
                                        <option>Bodega 1</option>
                                        <option>Bodega 2</option>
                                        <option>Bodega 3</option>
                                    </select>

                                    Imagen
                                    <input type="file" id="exampleInputFile">

                                    Observacion
                                    <textarea class="form-control"></textarea>

                <form action="lista_producto.php">
                    <button class="btn btn-primary btn-right btn-margin btn-lg" onclick="confirm('¿Desea modificar el registro?');" >Modificar</button>
                    <button class="btn btn-danger btn-right btn-margin btn-lg" >Cancelar</button>
                </form>

        <?php
            require('../../re-use/footer.php');
        ?>


text:
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the MIT license.  See License.txt in the project root for license information.

using System.Collections.Immutable;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.Editing;

namespace Microsoft.NetCore.Analyzers.Performance
{
    /// <summary>
    /// CA1836: Prefer IsEmpty over Count when available.
    /// </summary>
    public abstract class PreferIsEmptyOverCountFixer : CodeFixProvider
    {
        public sealed override ImmutableArray<string> FixableDiagnosticIds { get; } = ImmutableArray.Create(UseCountProperlyAnalyzer.CA1836);

        public sealed override FixAllProvider GetFixAllProvider() => WellKnownFixAllProviders.BatchFixer;

        public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context)
        {
            SyntaxNode root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false);
            SyntaxNode node = root.FindNode(context.Span, getInnermostNodeForTie: true);
            if (node == null)
            {
                return;
            }

            ImmutableDictionary<string, string> properties = context.Diagnostics[0].Properties;
            if (properties == null)
            {
                return;
            }

            // Indicates whether the Count method or property is on the Right or Left side of a binary expression
            // OR if it is the argument or the instance of an Equals invocation.
            string operationKey = properties[UseCountProperlyAnalyzer.OperationKey];

            // Indicates if the replacing IsEmpty node should be negated. (!IsEmpty).
            bool shouldNegate = properties.ContainsKey(UseCountProperlyAnalyzer.ShouldNegateKey);

            context.RegisterCodeFix(CodeAction.Create(
                title: MicrosoftNetCoreAnalyzersResources.PreferIsEmptyOverCountTitle,
                createChangedDocument: async cancellationToken =>
                {
                    DocumentEditor editor = await DocumentEditor.CreateAsync(context.Document, cancellationToken).ConfigureAwait(false);
                    SyntaxGenerator generator = editor.Generator;

                    // The object that the Count property belongs to OR null if countAccessor is not a MemberAccessExpressionSyntax.
                    SyntaxNode? objectExpression = GetObjectExpressionFromOperation(node, operationKey);

                    // The IsEmpty property meant to replace the binary expression.
                    SyntaxNode isEmptyNode = objectExpression is null ?
                        generator.IdentifierName(UseCountProperlyAnalyzer.IsEmpty) :
                        generator.MemberAccessExpression(objectExpression, UseCountProperlyAnalyzer.IsEmpty);

                    if (shouldNegate)
                    {
                        isEmptyNode = generator.LogicalNotExpression(isEmptyNode);
                    }

                    editor.ReplaceNode(node, isEmptyNode.WithTriviaFrom(node));
                    return editor.GetChangedDocument();
                },
                equivalenceKey: MicrosoftNetCoreAnalyzersResources.PreferIsEmptyOverCountMessage),
            context.Diagnostics);
        }

        /// <summary>
        /// The object that the Count method or property belongs to OR null if the Count method or property is not a MemberAccessExpressionSyntax.
        /// </summary>
        protected abstract SyntaxNode? GetObjectExpressionFromOperation(SyntaxNode node, string operationKey);
    }
}


text:
import com.hazelcast.cache.ICache;
import com.hazelcast.config.CacheSimpleConfig;
import com.hazelcast.jet.Jet;
import com.hazelcast.jet.JetInstance;
import com.hazelcast.jet.pipeline.Pipeline;
import com.hazelcast.jet.pipeline.Sinks;
import com.hazelcast.jet.pipeline.Sources;
import com.hazelcast.jet.config.JetConfig;

/**
 * Demonstrates the usage of Hazelcast ICache as source and sink
 * with the Pipeline API. This will take the contents of one cache
 * and write it into another cache.
 */
public class CacheSourceAndSink {

    private static final int ITEM_COUNT = 10;
    private static final String SOURCE_NAME = "source";
    private static final String SINK_NAME = "sink";

    public static void main(String[] args) throws Exception {
        System.setProperty("hazelcast.logging.type", "log4j");
        JetConfig config = new JetConfig();

        // Unlike with IMap, ICache names must be explicitly configured before using
        config.getHazelcastConfig()
              .addCacheConfig(new CacheSimpleConfig().setName(SOURCE_NAME))
              .addCacheConfig(new CacheSimpleConfig().setName(SINK_NAME));

        JetInstance jet = Jet.newJetInstance(config);

        try {
            ICache<Integer, Integer> sourceCache = jet.getCacheManager().getCache(SOURCE_NAME);
            for (int i = 0; i < ITEM_COUNT; i++) {
                sourceCache.put(i, i);
            }

            Pipeline p = Pipeline.create();
            p.drawFrom(Sources.cache(SOURCE_NAME))
             .drainTo(Sinks.cache(SINK_NAME));

            jet.newJob(p).join();

            ICache<Integer, Integer> sinkCache = jet.getCacheManager().getCache(SINK_NAME);
            System.out.println("Sink cache entries: ");
            sinkCache.forEach(e -> System.out.println(e.getKey() + "=" + e.getValue()));
        } finally {
            Jet.shutdownAll();
        }
    }
}


text:
import { gql } from '@apollo/client'

import passwordResettableUserFragment from 'v2/pages/authentication/ResetPasswordPage/fragments/passwordResettableUser'

export default gql`
  query PasswordResettableUser($reset_password_token: String!) {
    password_resettable_user(reset_password_token: $reset_password_token) {
      ...PasswordResettableUser
    }
  }
  ${passwordResettableUserFragment}
`


text:
title: About
date: 2014-10-12 00:57:12
---

Some details about myself


text:
// +k8s:deepcopy-gen=package,register
// +groupName=innsmouth.k8s.io

// Package api is the internal version of the API.
package innsmouth


text:
package org.carbon.authentication.conf;

import org.carbon.authentication.strategy.AuthStrategyRepository;
import org.carbon.component.annotation.Assemble;
import org.carbon.component.annotation.Component;
import org.carbon.component.annotation.Configuration;
import org.carbon.web.context.session.SessionPool;

/**
 * TODO add security logic per @Action
 *
 * @author Shota Oda 2016/10/28.
 */
@Configuration
public class AuthConfiguration {

    @Assemble
    private AuthConfigAdapter configAdapter;
    @Assemble
    private SessionPool sessionContext;
    @Assemble
    private AuthDefinitionBuilder authDefinitionBuilder;

    @Component
    public AuthStrategyRepository authStrategyRepository() {
        configAdapter.configure(authDefinitionBuilder);
        return authDefinitionBuilder.buildRepository(sessionContext);
    }
}


text:
package com.n1rocket.framework.mvp.ui.main;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.n1rocket.framework.mvp.ui.profile.ProfileFragment;
import com.n1rocket.framework.mvp.ui.sentences.SentencesFragment;

/**
 * Created by n1rocketdev on 25/05/2017.
 */

public class MainPagerAdapter extends FragmentStatePagerAdapter {

    private int mTabCount;

    public MainPagerAdapter(FragmentManager fragmentManager) {
        super(fragmentManager);
        this.mTabCount = 0;
    }

    @Override
    public Fragment getItem(int position) {

        switch (position) {
            case 0:
                return SentencesFragment.newInstance();
            case 1:
                return ProfileFragment.newInstance();
            default:
                return null;
        }
    }

    @Override
    public int getCount() {
        return mTabCount;
    }

    public void setCount(int count) {
        mTabCount = count;
    }
}