text:
"""
    Server API

    Reference for Server API (REST/Json)

    OpenAPI spec version: 2.0.21

    Generated by: https://github.com/swagger-api/swagger-codegen.git
"""

from __future__ import absolute_import

import sys
import os
import re

# python 2 and python 3 compatibility library
from six import iteritems

from ..configuration import Configuration
from ..api_client import ApiClient

class WidgetsApi(object):
    """
    NOTE: This class is auto generated by the swagger code generator program.
    Do not edit the class manually.
    Ref: https://github.com/swagger-api/swagger-codegen
    """

    def __init__(self, api_client=None):
        config = Configuration()
        if api_client:
            self.api_client = api_client
        else:
            if not config.api_client:
                config.api_client = ApiClient()
            self.api_client = config.api_client

    def get_slider_image(self, **kwargs):
        """
        Get slider images
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_slider_image(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: ImageListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_slider_image_with_http_info(**kwargs)
        else:
            (data) = self.get_slider_image_with_http_info(**kwargs)
            return data

    def get_slider_image_with_http_info(self, **kwargs):
        """
        Get slider images
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_slider_image_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: ImageListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_slider_image" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        resource_path = '/widgets/slider/images'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['ApiClientId', 'ApiClientSecret']

        return self.api_client.call_api(resource_path, 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='ImageListResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def get_widget_analytics(self, **kwargs):
        """
        Get Google Analytics configuration
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_analytics(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: GoogleAnalyticsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_widget_analytics_with_http_info(**kwargs)
        else:
            (data) = self.get_widget_analytics_with_http_info(**kwargs)
            return data

    def get_widget_analytics_with_http_info(self, **kwargs):
        """
        Get Google Analytics configuration
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_analytics_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :return: GoogleAnalyticsResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = []
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_widget_analytics" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        resource_path = '/widgets/analytics'.replace('{format}', 'json')
        path_params = {}

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['ApiClientId', 'ApiClientSecret']

        return self.api_client.call_api(resource_path, 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='GoogleAnalyticsResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def get_widget_footer_menu(self, **kwargs):
        """
        Get footer menu list
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_footer_menu(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int page:
        :param int per_page:
        :return: WidgetFooterMenuListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_widget_footer_menu_with_http_info(**kwargs)
        else:
            (data) = self.get_widget_footer_menu_with_http_info(**kwargs)
            return data

    def get_widget_footer_menu_with_http_info(self, **kwargs):
        """
        Get footer menu list
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_footer_menu_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int page:
        :param int per_page:
        :return: WidgetFooterMenuListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['page', 'per_page']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_widget_footer_menu" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        resource_path = '/widgets/footer-menu'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'page' in params:
            query_params['page'] = params['page']
        if 'per_page' in params:
            query_params['per_page'] = params['per_page']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['ApiClientId', 'ApiClientSecret']

        return self.api_client.call_api(resource_path, 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='WidgetFooterMenuListResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def get_widget_home_rail(self, **kwargs):
        """
        Get home rails list
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_home_rail(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int page:
        :param int per_page:
        :return: WidgetHomeRailListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_widget_home_rail_with_http_info(**kwargs)
        else:
            (data) = self.get_widget_home_rail_with_http_info(**kwargs)
            return data

    def get_widget_home_rail_with_http_info(self, **kwargs):
        """
        Get home rails list
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_home_rail_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int page:
        :param int per_page:
        :return: WidgetHomeRailListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['page', 'per_page']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_widget_home_rail" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        resource_path = '/widgets/home-rail'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'page' in params:
            query_params['page'] = params['page']
        if 'per_page' in params:
            query_params['per_page'] = params['per_page']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['ApiClientId', 'ApiClientSecret']

        return self.api_client.call_api(resource_path, 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='WidgetHomeRailListResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def get_widget_home_rail_video(self, homerail_id, **kwargs):
        """
        Get home rails list
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_home_rail_video(homerail_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int homerail_id: Homerail ID to fetch (required)
        :param int page:
        :param int per_page:
        :return: WidgetHomeRailVideoListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_widget_home_rail_video_with_http_info(homerail_id, **kwargs)
        else:
            (data) = self.get_widget_home_rail_video_with_http_info(homerail_id, **kwargs)
            return data

    def get_widget_home_rail_video_with_http_info(self, homerail_id, **kwargs):
        """
        Get home rails list
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_home_rail_video_with_http_info(homerail_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int homerail_id: Homerail ID to fetch (required)
        :param int page:
        :param int per_page:
        :return: WidgetHomeRailVideoListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['homerail_id', 'page', 'per_page']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_widget_home_rail_video" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'homerail_id' is set
        if ('homerail_id' not in params) or (params['homerail_id'] is None):
            raise ValueError("Missing the required parameter `homerail_id` when calling `get_widget_home_rail_video`")

        collection_formats = {}

        resource_path = '/widgets/home-rail/{homerail_id}/videos'.replace('{format}', 'json')
        path_params = {}
        if 'homerail_id' in params:
            path_params['homerail_id'] = params['homerail_id']

        query_params = {}
        if 'page' in params:
            query_params['page'] = params['page']
        if 'per_page' in params:
            query_params['per_page'] = params['per_page']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['ApiClientId', 'ApiClientSecret']

        return self.api_client.call_api(resource_path, 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='WidgetHomeRailVideoListResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def get_widget_hook_phrase(self, **kwargs):
        """
        Get hook phrase list
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_hook_phrase(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int page:
        :param int per_page:
        :return: WidgetHookPhraseListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_widget_hook_phrase_with_http_info(**kwargs)
        else:
            (data) = self.get_widget_hook_phrase_with_http_info(**kwargs)
            return data

    def get_widget_hook_phrase_with_http_info(self, **kwargs):
        """
        Get hook phrase list
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_hook_phrase_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int page:
        :param int per_page:
        :return: WidgetHookPhraseListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['page', 'per_page']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_widget_hook_phrase" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        resource_path = '/widgets/hook-phrase'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'page' in params:
            query_params['page'] = params['page']
        if 'per_page' in params:
            query_params['per_page'] = params['per_page']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['ApiClientId', 'ApiClientSecret']

        return self.api_client.call_api(resource_path, 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='WidgetHookPhraseListResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def get_widget_slider(self, **kwargs):
        """
        Get slider list
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_slider(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int page:
        :param int per_page:
        :return: WidgetSliderListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_widget_slider_with_http_info(**kwargs)
        else:
            (data) = self.get_widget_slider_with_http_info(**kwargs)
            return data

    def get_widget_slider_with_http_info(self, **kwargs):
        """
        Get slider list
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_slider_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int page:
        :param int per_page:
        :return: WidgetSliderListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['page', 'per_page']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_widget_slider" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        resource_path = '/widgets/slider'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'page' in params:
            query_params['page'] = params['page']
        if 'per_page' in params:
            query_params['per_page'] = params['per_page']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['ApiClientId', 'ApiClientSecret']

        return self.api_client.call_api(resource_path, 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='WidgetSliderListResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def get_widget_slider_item(self, slider_id, **kwargs):
        """
        Get slider item
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_slider_item(slider_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int slider_id: Slider ID to fetch (required)
        :return: WidgetSliderResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_widget_slider_item_with_http_info(slider_id, **kwargs)
        else:
            (data) = self.get_widget_slider_item_with_http_info(slider_id, **kwargs)
            return data

    def get_widget_slider_item_with_http_info(self, slider_id, **kwargs):
        """
        Get slider item
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_slider_item_with_http_info(slider_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int slider_id: Slider ID to fetch (required)
        :return: WidgetSliderResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['slider_id']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_widget_slider_item" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'slider_id' is set
        if ('slider_id' not in params) or (params['slider_id'] is None):
            raise ValueError("Missing the required parameter `slider_id` when calling `get_widget_slider_item`")

        collection_formats = {}

        resource_path = '/widgets/slider/{slider_id}'.replace('{format}', 'json')
        path_params = {}
        if 'slider_id' in params:
            path_params['slider_id'] = params['slider_id']

        query_params = {}

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['ApiClientId', 'ApiClientSecret']

        return self.api_client.call_api(resource_path, 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='WidgetSliderResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def get_widget_slider_video_player(self, slider_id, **kwargs):
        """
        Get video player
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_slider_video_player(slider_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int slider_id: Slider ID to fetch (required)
        :param int customer_id: Customer ID to fetch
        :param int country_id: Country ID to use in video analytics
        :return: Player
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_widget_slider_video_player_with_http_info(slider_id, **kwargs)
        else:
            (data) = self.get_widget_slider_video_player_with_http_info(slider_id, **kwargs)
            return data

    def get_widget_slider_video_player_with_http_info(self, slider_id, **kwargs):
        """
        Get video player
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_slider_video_player_with_http_info(slider_id, callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int slider_id: Slider ID to fetch (required)
        :param int customer_id: Customer ID to fetch
        :param int country_id: Country ID to use in video analytics
        :return: Player
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['slider_id', 'customer_id', 'country_id']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_widget_slider_video_player" % key
                )
            params[key] = val
        del params['kwargs']
        # verify the required parameter 'slider_id' is set
        if ('slider_id' not in params) or (params['slider_id'] is None):
            raise ValueError("Missing the required parameter `slider_id` when calling `get_widget_slider_video_player`")

        collection_formats = {}

        resource_path = '/widgets/slider/{slider_id}/player'.replace('{format}', 'json')
        path_params = {}
        if 'slider_id' in params:
            path_params['slider_id'] = params['slider_id']

        query_params = {}
        if 'customer_id' in params:
            query_params['customer_id'] = params['customer_id']
        if 'country_id' in params:
            query_params['country_id'] = params['country_id']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['ApiClientId', 'ApiClientSecret']

        return self.api_client.call_api(resource_path, 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='Player',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)

    def get_widget_top_menu(self, **kwargs):
        """
        Get top menu list
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_top_menu(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int page:
        :param int per_page:
        :return: WidgetTopMenuListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """
        kwargs['_return_http_data_only'] = True
        if kwargs.get('callback'):
            return self.get_widget_top_menu_with_http_info(**kwargs)
        else:
            (data) = self.get_widget_top_menu_with_http_info(**kwargs)
            return data

    def get_widget_top_menu_with_http_info(self, **kwargs):
        """
        Get top menu list
        This method makes a synchronous HTTP request by default. To make an
        asynchronous HTTP request, please define a `callback` function
        to be invoked when receiving the response.
        >>> def callback_function(response):
        >>>     pprint(response)
        >>>
        >>> thread = api.get_widget_top_menu_with_http_info(callback=callback_function)

        :param callback function: The callback function
            for asynchronous request. (optional)
        :param int page:
        :param int per_page:
        :return: WidgetTopMenuListResponse
                 If the method is called asynchronously,
                 returns the request thread.
        """

        all_params = ['page', 'per_page']
        all_params.append('callback')
        all_params.append('_return_http_data_only')
        all_params.append('_preload_content')
        all_params.append('_request_timeout')

        params = locals()
        for key, val in iteritems(params['kwargs']):
            if key not in all_params:
                raise TypeError(
                    "Got an unexpected keyword argument '%s'"
                    " to method get_widget_top_menu" % key
                )
            params[key] = val
        del params['kwargs']

        collection_formats = {}

        resource_path = '/widgets/top-menu'.replace('{format}', 'json')
        path_params = {}

        query_params = {}
        if 'page' in params:
            query_params['page'] = params['page']
        if 'per_page' in params:
            query_params['per_page'] = params['per_page']

        header_params = {}

        form_params = []
        local_var_files = {}

        body_params = None
        # Authentication setting
        auth_settings = ['ApiClientId', 'ApiClientSecret']

        return self.api_client.call_api(resource_path, 'GET',
                                        path_params,
                                        query_params,
                                        header_params,
                                        body=body_params,
                                        post_params=form_params,
                                        files=local_var_files,
                                        response_type='WidgetTopMenuListResponse',
                                        auth_settings=auth_settings,
                                        callback=params.get('callback'),
                                        _return_http_data_only=params.get('_return_http_data_only'),
                                        _preload_content=params.get('_preload_content', True),
                                        _request_timeout=params.get('_request_timeout'),
                                        collection_formats=collection_formats)


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Oracle.DataAccess.Client;
using System.Data;
using System.IO;
using System.Diagnostics;
using System.Drawing;

namespace RT {
	static class Program {
		#region Constants
		// Colors
		public static Color PARAMETER_COLOR = Color.FromArgb(192, 224, 255);
		public static Color RETURN_VALUE_COLOR = Color.FromArgb(224, 255, 224);

		// Command-line argument names
		public const string MULTIPLE_INSTANCES = "multipleinstances";
		public const string RUN_DB_ARG = "rundb";
		public const string HELP_ARG = "?";

		// Cell value indicators
		public const string MATRIX_CELL_TEXT_INDICATOR = "<matrix...>";
		public const string STRONG_REF_CURSOR_CELL_TEXT_INDICATOR = "<strng rf crsr...>";
		public const string TYPE_CELL_TEXT_INDICATOR = "<type...>";
		#endregion

		#region Form variables
		// Main form
		public static frmMain mainForm;

		// Docked forms
		public static frmNavigation navigationForm;
		public static frmOutput outputForm;
		public static frmTest testForm;
		public static frmSCNGroup scnGroupForm;
		public static frmLibraryItems libraryItemsForm;
		public static frmScenarioGroupStartupHook scenarioGroupStartupForm;
		public static frmScenarioStartupHook scenarioStartupForm;
		public static frmScenarios scenariosForm;
		public static frmPostParamAssignmentHook postParamAssignmentForm;
		public static frmPreUDCsHook preUDCsForm;
		public static frmUDC udcForm;
		public static frmScenarioTeardownHook scenarioTeardownForm;
		public static frmScenarioGroupTeardownHook scenarioGroupTeardownForm;
		#endregion

		// Project
		public static project currProject;

		// Global field change tracker
		public static RT.fieldChangeTracker fieldTracker = new RT.fieldChangeTracker();

		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static int Main(string[] args) {
			Boolean singleAppInstance = true; // Assume that we only want one instance of the program running.

			int returnCode = 0;
			bool launchGUI = true; // Whether or not to launch the GUI (certain command line arguments don't need the GUI)

			updateUserSettings();

			// Open up the default project...
			if (Properties.Settings.Default.repos_exportPath != "" && Directory.Exists(path: Properties.Settings.Default.repos_exportPath)) {
				currProject = new project(projectFilename: Properties.Settings.Default.repos_exportPath + "project.xml", excludedSchemas: Properties.Settings.Default.schemas_excludedSchemas);
			}

			if (args.Length > 0) {
				// Running in command line mode...
				string unrecognizedArgs = String.Empty;
				bool showArgHelp = false;
				string argHelp = String.Empty;

				// Give the user any unrecognized arguments and show him the valid arguments...
				if (unrecognizedArgs != String.Empty) {
					argHelp = "Unrecognized Arguments: " + unrecognizedArgs.TrimEnd(' ') + "\n\n";

					returnCode = 1;
				} else {
					try {
						for (int i = 0; i < args.Length; i++) {
							string argumentKeyValue = args[i];

							string argumentKey = argumentKeyValue.Trim('/').Split('=')[0].ToLower();
							string argumentValue = string.Empty;

							if (argumentKeyValue.Trim('/').Split('=').Count() == 2) {
								argumentValue = argumentKeyValue.Trim('/').Split('=')[1];
							}

							switch (argumentKey) {
								case MULTIPLE_INSTANCES:
									singleAppInstance = false;
									break;

								case RUN_DB_ARG:
									Program.openDBConnections();

									Program.currProject.repository.runAllTests(currProject: Program.currProject);

									Program.closeDBConnections();

									launchGUI = false;

									break;

								case HELP_ARG:
									showArgHelp = true;
									launchGUI = false;
									break;

								default:
									showArgHelp = true;

									break;
							}
						}
					} catch (Exception err) {
						MessageBox.Show(err.Message);
					}
				}

				if (showArgHelp) {
					string argsString = String.Empty;

					for (int i = 0; i < args.Count(); i++) {
						argsString += "\"" + args[i] + "\" ";
					}

					argHelp +=
						"Arguments:\n" +
						"/" + MULTIPLE_INSTANCES + " - Allows multiple instances of the program\n" +
						"/" + RUN_DB_ARG + " - Runs all tests against the target DB\n" +
						"/" + HELP_ARG + " - This help list\n\n" +
						"Actually Passed: " + argsString;

					MessageBox.Show(argHelp);
				}
			}

			if (launchGUI) {
				// Running in interactive mode....
				Application.EnableVisualStyles();
				Application.SetCompatibleTextRenderingDefault(false);

				if (singleAppInstance)
					myCustomApplication.Run(mainForm = new frmMain());
				else
					Application.Run(mainForm = new frmMain());

				// Close open connections
				closeDBConnections();
			}

			return returnCode;
		}

		private static void updateUserSettings() {
			System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly();
			Version appVersion = a.GetName().Version;
			string appVersionString = appVersion.ToString();

			if (Properties.Settings.Default.app_version != appVersion.ToString()) {
				Properties.Settings.Default.Upgrade();
				Properties.Settings.Default.app_version = appVersionString;
			}
		}

		public static OracleConnection getCurrentTargetDBConnection() {
			return ((databaseTreeNode) Program.navigationForm.projectTreeView.selectedNode.getParentNode(schemaNodeType.database)).targetDatabase.conTargetDB;
		}

		// Re-opens any already-open connections
		public static void reopenDBConnections() {
			if (currProject != null) {
				for (int i = 0; i < currProject.targetDBs.Count; i++) {
					if (currProject.targetDBs[i].conTargetDB.State == ConnectionState.Open) {
						currProject.targetDBs[i].conTargetDB.Close();
						currProject.targetDBs[i].conTargetDB.Open();
					}
				}
			}
		}

		// Opens the application-wide connections to the target database and repository database.
		public static void openDBConnections(bool showPreferencesDialog = true) {
			closeDBConnections();

			if (Properties.Settings.Default.target_dbUsername != "" && Properties.Settings.Default.target_dbPassword != String.Empty) {
				for (int i = 0; i < currProject.targetDBs.Count; i++) {
					currProject.targetDBs[i].open(username: Properties.Settings.Default.target_dbUsername, password: RT.security.DecryptString(Properties.Settings.Default.target_dbPassword));

					if (currProject.targetDBs[i].conTargetDB.State != ConnectionState.Open) {
						if (showPreferencesDialog) {
							frmPreferences myForm = new frmPreferences();

							myForm.ShowDialog();
						} else {
							throw new Exception("Couldn't open connections.");
						}
					}
				}
			} else {
				MessageBox.Show("Database credentials not set!");
			}
		}

		// Closes the application-wide connections, if necessary
		public static void closeDBConnections() {
			if (currProject != null) {
				for (int i = 0; i < currProject.targetDBs.Count; i++) {
					if (currProject.targetDBs[i].conTargetDB.State == ConnectionState.Open) {
						currProject.targetDBs[i].conTargetDB.Close();
					}
				}
			}
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { AddonModAssignEditFeedbackModalPage } from './edit-feedback-modal';
import { TranslateModule } from '@ngx-translate/core';
import { CoreComponentsModule } from '@components/components.module';
import { CoreDirectivesModule } from '@directives/directives.module';
import { AddonModAssignComponentsModule } from '../../components/components.module';

@NgModule({
    declarations: [
        AddonModAssignEditFeedbackModalPage
    ],
    imports: [
        CoreComponentsModule,
        CoreDirectivesModule,
        AddonModAssignComponentsModule,
        IonicPageModule.forChild(AddonModAssignEditFeedbackModalPage),
        TranslateModule.forChild()
    ]
})
export class AddonModAssignEditFeedbackModalPageModule {}


text:
package scala.reflect.io

import java.io.Closeable
import java.nio
import java.nio.file.Files
import java.nio.file.spi.FileSystemProvider

import scala.collection.JavaConverters.collectionAsScalaIterableConverter

abstract class RootPath extends Closeable {
  def root: nio.file.Path
}

object RootPath {
  private lazy val jarFsProvider = FileSystemProvider.installedProviders().asScala.find(_.getScheme == "jar").getOrElse(throw new RuntimeException("No jar filesystem provider"))
  def apply(path: nio.file.Path, writable: Boolean): RootPath = {
    if (path.getFileName.toString.endsWith(".jar")) {
      val env = new java.util.HashMap[String, String]()
      if (!Files.exists(path.getParent))
        Files.createDirectories(path.getParent)
      if (writable) {
        env.put("create", "true")
        if (Files.exists(path))
          Files.delete(path)
      }
      val zipfs = jarFsProvider.newFileSystem(path, env)

      new RootPath {
        def root = zipfs.getRootDirectories.iterator().next()
        def close(): Unit = {
          zipfs.close()
        }
        override def toString: String = path.toString
      }
    } else {
      new RootPath {
        override def root: nio.file.Path = path
        override def close(): Unit = ()
        override def toString: String = path.toString
      }
    }
  }
}


text:
	#pragma import on
#endif

PP_Begin_Namespace_PowerPlant

// ---------------------------------------------------------------------------

class	LModelProperty : public LModelObject {
public:
					LModelProperty(
							DescType			inPropertyID,
							LModelObject*		inSuperModel,
							Boolean				inBeLazy = true);

	virtual			~LModelProperty();

	virtual void	HandleAppleEvent(
							const AppleEvent&	inAppleEvent,
							AppleEvent&			outAEReply,
							AEDesc&				outResult,
							SInt32				inAENumber);

	void			SendSetDataAE(
							DescType			inDataType,
							Ptr					inDataPtr,
							Size				inDataSize,
							Boolean				inExecute = true);

	void			SendSetDataAEDesc(
							const AEDesc&		inDesc,
							Boolean				inExecute = true);

	virtual Boolean	CompareToDescriptor(
							DescType			inComparisonOperator,
							const AEDesc&		inCompareDesc) const;

protected:
	DescType		mPropertyID;

	virtual void	MakeSelfSpecifier(
							AEDesc&				inSuperSpecifier,
							AEDesc&				outSelfSpecifier) const;

	virtual void	HandleGetData(
							const AppleEvent&	inAppleEvent,
							AEDesc&				outResult,
							SInt32				inAENumber);

	virtual void	HandleSetData(
							const AppleEvent&	inAppleEvent,
							AppleEvent&			outAEReply);
};

PP_End_Namespace_PowerPlant

#if PP_Uses_Pragma_Import
	#pragma import reset
#endif

#endif


text:
"""
Module that classifies data using an independent model.
"""
import os
from scipy.sparse import hstack
from scipy.sparse import csr_matrix

class Classification:
    """Class to classify data using an independent model."""

    def __init__(self, config_obj, content_features_obj, graph_features_obj,
                 relational_features_obj, util_obj):
        """Initializes object dependencies."""

        self.config_obj = config_obj
        """User settings object."""
        self.cf_obj = content_features_obj
        """Class to construct features based on text content."""
        self.gf_obj = graph_features_obj
        """Class to construct graphical features."""
        self.rf_obj = relational_features_obj
        """Class to construct relational features."""
        self.util_obj = util_obj
        """Utility class that does graphing, classification, etc."""

    # public
    def main(self, train_df, test_df, dset='test', fw=None):
        """Constructs paths, merges data, converts, and processes data to be
        read by the independent model.
        train_df: original training comments dataframe.
        test_df: original testing comments dataframe.
        dset: datatset to test (e.g. 'val', 'test')."""
        fold = self.config_obj.fold
        classifier = self.config_obj.classifier
        plot_features = not self.config_obj.ngrams
        featureset = 'all'

        image_f, pred_f, model_f = self.file_folders()
        data = self.build_and_merge(train_df, test_df, dset, fw=fw)

        self.util_obj.classify(data, fold, featureset, image_f, pred_f,
                model_f, classifier=classifier, save_feat_plot=plot_features,
                dset=dset, fw=fw)

    # private
    def file_folders(self):
        """Returns absolute path directories."""
        ind_dir = self.config_obj.ind_dir
        domain = self.config_obj.domain

        out_f = ind_dir + 'output/' + domain
        image_f = out_f + '/images/'
        pred_f = out_f + '/predictions/'
        model_f = out_f + '/models/'
        if not os.path.exists(image_f):
            os.makedirs(image_f)
        if not os.path.exists(pred_f):
            os.makedirs(pred_f)
        if not os.path.exists(model_f):
            os.makedirs(model_f)
        return image_f, pred_f, model_f

    def merge(self, coms_df, c_df, g_df, r_df):
        """Merges the features dataframes with the comments dataframe.
        coms_df: original data.
        c_df: content features.
        g_df: graph features.
        r_df: relational features.
        Returns the merged dataframe."""
        feats_df = coms_df.merge(c_df, on='com_id', how='left')
        feats_df = feats_df.merge(g_df, on='com_id', how='left')
        feats_df = feats_df.merge(r_df, on='com_id', how='left')
        return feats_df

    def drop_columns(self, feats_df, feats_list):
        """Drops columns not related to the features (e.g. com_id, etc.).
        feats_df: merged feature dataframe.
        feats_list: list of features to be used for classification.
        Returns the filtered dataframe."""
        return feats_df[feats_list]

    def dataframe_to_matrix(self, feats_df):
        """Converts the dataframe to a matrix.
        feats_df: filtered dataframe.
        Returns the dataframe as a matrix."""
        return csr_matrix(feats_df.as_matrix())

    def stack_matrices(self, feats_m, c_csr):
        """Merges the matrices into one matrix.
        feats_m: coverted feature matrix.
        c_csr: sparse ngram matrix.
        Returns sparse merged matrix."""
        stack = [feats_m]
        if c_csr is not None:
            stack.append(c_csr)
        return hstack(stack).tocsr()

    def extract_labels(self, coms_df):
        """Extracts the ground truth labels.
        coms_df: original data.
        Returns a tuple of numpy arrays: labels and ids."""
        return coms_df['label'].values, coms_df['com_id'].values

    def prepare(self, df, c_m, c_df, g_df, r_df, feats_list):
        """Takes specified dataset, ngram sparse matrix, and feature frames
        and processes them into features and labels to feed into the model.
        df: training, validation, or testing dataframe.
        c_m: ngram sparse matrix.
        c_df: content features dataframe.
        g_df: graph features dataframe.
        r_df: relational features dataframe.
        feats_list: list of feature names.
        Returns features x as a sparse matrix, and labels y as an ndarray."""
        feats_df = self.merge(df, c_df, g_df, r_df)
        feats_df = self.drop_columns(feats_df, feats_list)
        feats_m = self.dataframe_to_matrix(feats_df)
        x = self.stack_matrices(feats_m, c_m)
        y, ids = self.extract_labels(df)
        return x, y, ids

    def build_and_merge(self, train_df, test_df, dset, fw=None):
        """Builds the featuresets and merges the features into one datafram.
        train_df: training set dataframe.
        test_df: test set dataframe.
        dset: dataset to test (e.g. 'val', 'test').
        Returns the training and testing feature and label dataframes, and a
                list of all computed features."""
        m_tr, m_te, c_df, c_feats = self.cf_obj.build(train_df, test_df, dset,
                fw=fw)
        g_df, g_feats = self.gf_obj.build(train_df, test_df, fw=fw)
        r_df, r_feats = self.rf_obj.build(train_df, test_df, dset, fw=fw)

        self.util_obj.start('merging features...', fw=fw)
        feats = c_feats + g_feats + r_feats
        x_tr, y_tr, _ = self.prepare(train_df, m_tr, c_df, g_df, r_df,
                feats)
        x_te, y_te, id_te = self.prepare(test_df, m_te, c_df, g_df, r_df,
                feats)
        self.util_obj.end(fw=fw)
        return x_tr, y_tr, x_te, y_te, id_te, feats


text:
require_relative '../../app/presenters/theme_presentation'
require 'delegate'

class Model
  def to_model
    'model'
  end

  def name
    'model'
  end
end

class Presenter1 < SimpleDelegator
  def initialize(data)
    super(data)
  end

  def name
    'Presenter1'
  end
end

class Presenter2 < SimpleDelegator
  def initialize(data)
    super(data)
  end

  def name
    'Presenter2'
  end
end

describe ThemePresentation do
  describe '.wrap(data, *presenters)' do
    describe 'when data is a hash' do
      let(:hash) { { key: 'value' } }

      it 'returns a struct instead of a hash' do
        ThemePresentation.wrap(hash).key.should == 'value'
      end

      it 'can wrap hashes as well' do
        data = ThemePresentation.wrap(hash, Presenter1, nil)
        data.key.should == 'value'
      end
    end

    describe 'when data is a hash with an array of hashes' do
      let :hash do
        {
          key: 'value',
          array: [
            {
              key: 'value'
            },
            {
              another_key: 'another value'
            }
          ]
        }
      end

      it 'returns a nested struct' do
        ThemePresentation.wrap(hash).array[0].key.should == 'value'
        ThemePresentation.wrap(hash).array[1].another_key.should == 'another value'
      end
    end

    describe 'when data is a model object' do
      it "should return a class of type Model" do
        ThemePresentation.wrap(Model.new).should be_a(Model)
      end

      it "should return the model" do
        ThemePresentation.wrap(Model.new).to_model.should == 'model'
      end
    end

    describe 'when presenters are passed in' do
      before do
        @data = ThemePresentation.wrap(Model.new, Presenter1, Presenter2, nil)
      end

      it 'exposes which presenters have wrapped it' do
        @data.wrapped_by.should == [Presenter1, Presenter2]
      end

      it 'wraps in order' do
        @data.name.should == 'Presenter2'
      end
    end
  end

  describe '.wrap_collection(collection, *presenters)' do
    before do
      @collection = ThemePresentation.wrap_collection([Model.new, Model.new, Model.new], Presenter1, Presenter2, nil)
    end

    it 'wraps each item in the collection' do
      @collection.each do |item|
        item.wrapped_by.should == [Presenter1, Presenter2]
      end
    end
  end
end


text:
<?php

namespace Taco\Domains;

/**
 * Většina agragací jen kopíruje
 *
 * @author Martin Takáč (taco@taco-beru.name)
 */
abstract class Agregation implements IAgregation, ICriteria
{

	/**
	 * Dekorator instance, na kterou se převádí funkce.
	 */
	private $criteria;

	/**
	 * Dekorator pro Criteria.
	 * @param criteria.
	 */
	function __construct(ICriteria $criteria)
	{
		$this->criteria = $criteria;
	}

	/**
	 * @see ICriteria::getTypeName()
	 */
	function getTypeName()
	{
		return $this->criteria->getTypeName();
	}

	/**
	 * Standardní metoda readeru, která získává data.
	 * @return string
	 */
	abstract function getReadMethod();

	/**
	 * Zvoli, ktere atributy entity chcem.
	 *
	 * @example:
	 * $model->with('id')     // Chceme sloupecek id
	 *  ->with('*')           // Vsechny prvky, bez asociaci
	 *  ->with('title')       // Chceme title
	 *  ->with('discuss.id')  // Chceme hodnoty asociace discus, ale z ni jen id
	 *  ->with('vote.*')      // Chceme vsechny hodnoty asociace vote
	 *
	 * @params string
	 * @see ICriteria::with()
	 *
	 * @return self
	 */
	function with($name, $filter = Null)
	{
		$this->criteria->with($name, $filter);
		return $this;
	}

	/**
	 * Zvoli, na ktere sloupce budem filtrovat.
	 *
	 * @example:
	 * $model->where('id = ?', "56")   // Podle validace zkontroluje, ze tam ma byt int.
	 *  ->where('id IS NOT NULL')
	 *  ->where('title = ? OR title = ?', 'foo', 'boo')
	 *  ->where('discuss.id = ?', 6)
	 *  ->where('vote.create BETWEEN ? AND ?', time(), time()+100)
	 *  ->where('role IN (?)', array(1, 4, 6))
	 *
	 * @see ICriteria::where()
	 * @params more
	 *
	 * @return self
	 */
	function where($expresion)
	{
		$args = func_get_args();
		call_user_func_array(array($this->criteria, 'where'), $args);
		return $this;
	}

	/**
	 * Razeni.
	 *
	 * @example:
	 * $model->orderByDesc('id')
	 *  ->orderByDesc('title')
	 *  ->orderByDesc('title = "cs"')
	 *
	 * @see ICriteria::orderByDesc()
	 * @params string
	 *
	 * @return self
	 */
	function orderByDesc($by)
	{
		return $this->criteria->orderByDesc($by);
	}

	/**
	 * Razeni.
	 *
	 * @see ICriteria::orderByDesc()
	 * @params string
	 *
	 * @return self
	 */
	function orderByAsc($by)
	{
		return $this->criteria->orderByAsc($by);
	}

	/**
	 * Omezení.
	 *
	 * @see ICriteria::limit()
	 * @params integer
	 *
	 * @return self
	 */
	function limit($value)
	{
		return $this->criteria->limit($value);
	}

	/**
	 * Omezení.
	 *
	 * @see ICriteria::offset()
	 * @params integer
	 *
	 * @return self
	 */
	function offset($value)
	{
		return $this->criteria->offset($value);
	}

	/** freezable *****************************************************/

	/**
	 * Makes the object unmodifiable.
	 * @return void
	 */
	function __call($method, $args)
	{
		return call_user_func_array(array($this->criteria, $method), $args);
	}

	/**
	 * Creates a modifiable clone of the object.
	 * @return void
	 */
	function __clone()
	{
		clone $this->criteria;
	}

}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <include layout="@layout/common_title" />

    <FrameLayout
        android:id="@+id/map_container"
        android:layout_weight="1"
        android:layout_width="match_parent"
        android:layout_height="0dp">
    </FrameLayout>

    <!--tabs 显示在上面的布局-->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="250dp"
        android:orientation="vertical" >

        <android.support.v4.app.FragmentTabHost
            android:id="@android:id/tabhost"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >

            <FrameLayout
                android:id="@android:id/tabcontent"
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_weight="0" />
        </android.support.v4.app.FragmentTabHost>

        <FrameLayout
            android:id="@+id/real_tab_content"
            android:layout_width="fill_parent"
            android:layout_height="0dip"
            android:layout_weight="1" />
    </LinearLayout>

</LinearLayout>


text:
'''
Master listens on port default 8000, but it is indtended to run on port 80.
It is web app that manages slaves.
It allows users to register, and manage their instances/containers.
Admin is allowed to modify many aspects of web app.

Sections:
    Dashboard
        - live stats
        - earning [super-only]
        - spending [user-only]

    Hosts [super]
        - list
        - add
        - remove
        - update

    Images [per-user, or all for super]
        - list
        - add
        - remove
        - update

    Volumes
        - list
        - add
        - remove
        - update [only name]

    Containers [per-user, or all for super]
        - list
        - create

        # - clone
        - start
        - restart
        - stop
        - attach
        - logs
        - destory

    Networking
        - list
        - add
        - remove
        - update

    Settings [super]
        - set title
        - set logo

    Profile
        - update
'''

__all__ = ['app']
import os
import sys
from ConfigParser import SafeConfigParser

# requests
import requests

# werkzeug
from werkzeug.contrib.fixers import ProxyFix

# flask
from flask import (
    Flask, request, session, g,
    redirect, url_for, abort,
    render_template, flash, jsonify,
    Blueprint, abort,
    send_from_directory,
    current_app,
)

# flask login
from flask.ext.login import (
    current_user, login_required, fresh_login_required,
    login_user, logout_user, confirm_login,
)

# config
from config.flask import FlaskConfig
_flask_config_path = os.path.join('config', 'flask.conf')

if os.path.exists(_flask_config_path):
    cp = SafeConfigParser()
    cp.optionxform = str
    cp.read(_flask_config_path)
    items = cp.items('FlaskConfig')
    items = dict(items)
    FlaskConfig.__dict__.update(items)

# app
app = Flask(__name__)

if FlaskConfig.PROXY_FIX:
    app.wsgi_app = ProxyFix(app.wsgi_app)

app.config.from_object(FlaskConfig)

# flask-sqlalchemy
from model.db import init_db, object_to_dict, objects_to_list
db = init_db(app)

# model
from model.user import UserAccount, UserQuota, UserStat
from model.host import Host
from model.image import Image
from model.volume import Volume
from model.mount import MountPoint
from model.container import Container
from model.network import Domain, Route

# model - create all tables
# db.drop_all()
db.create_all()

# create super user if does not exits
if not UserAccount.query.filter_by(username='admin').count():
    user_account = UserAccount(
        username = 'admin',
        password = 'd0cky4rd',
        email = 'dockyard@example.com',
        usertype = 'super',
    )
    db.session.add(user_account)
    db.session.commit()

# create quota for super user
if not UserQuota.query.filter_by(username='admin').count():
    user_quota = UserQuota(
        username = 'admin',
    )
    db.session.add(user_quota)
    db.session.commit()

# create stat for super user
if not UserStat.query.filter_by(username='admin').count():
    user_stat = UserStat(
        username = 'admin',
    )
    db.session.add(user_stat)
    db.session.commit()

# account
from account import account_blueprint, login_manager
app.register_blueprint(account_blueprint)
login_manager.init_app(app)

# dashboard
from dashboard import dashboard_blueprint
app.register_blueprint(dashboard_blueprint)

# host
from host import host_blueprint
app.register_blueprint(host_blueprint)

# image
from image import image_blueprint
app.register_blueprint(image_blueprint)

# mount
from mount import mount_blueprint
app.register_blueprint(mount_blueprint)

# volume
from volume import volume_blueprint
app.register_blueprint(volume_blueprint)

# container
from container import container_blueprint
app.register_blueprint(container_blueprint)

# network
from network import network_blueprint
app.register_blueprint(network_blueprint)

# term
from term import term_blueprint
app.register_blueprint(term_blueprint)

@app.route('/')
def index():
    return redirect(url_for(FlaskConfig.DEFAULT_VIEW))

@app.route('/favicon.ico')
def favicon():
    return send_from_directory(
        os.path.join(app.root_path, 'static', 'dockyard', 'img'),
        'favicon.ico',
        mimetype='image/vnd.microsoft.icon',
    )

@app.route('/robots.txt')
def robots():
    return send_from_directory(
        os.path.join(app.root_path, 'static', 'dockyard', 'other'),
        'robots.txt',
        mimetype='text/plain',
    )

@app.errorhandler(403)
def forbidden(e):
    return render_template('403.html'), 403

@app.errorhandler(404)
def not_found(e):
    return render_template('404.html'), 404

@app.errorhandler(410)
def gone(e):
    return render_template('410.html'), 410

@app.errorhandler(500)
def internal_server_error(e):
    return render_template('500.html'), 500

if __name__ == '__main__':
    import argparse

    # parse cli arguments
    parser = argparse.ArgumentParser()

    parser.add_argument('-b', '--bind', type=str,
                        default='{HOST}:{PORT}'.format(**FlaskConfig.__dict__),
                        help='bind to host:port')

    parser.add_argument('-t', '--threaded', type=bool,
                        default=FlaskConfig.THREADED,
                        help='threaded execution')

    args = parser.parse_args()

    # host, port
    host_port = args.bind.split(':')

    if len(host_port) == 1:
        host = host_port[0]
        port = FlaskConfig.PORT
    else:
        host = host_port[0]
        port = int(host_port[1])

    FlaskConfig.HOST = host
    FlaskConfig.PORT = port
    FlaskConfig.THREADED = args.threaded

    # run app
    app.run(
        host = FlaskConfig.HOST,
        port = FlaskConfig.PORT,
        threaded = FlaskConfig.THREADED,
    )


text:
CKEDITOR.plugins.setLang( 'pagebreak', 'ca', {
	alt: 'Salt de pàgina',
	toolbar: 'Insereix salt de pàgina'
});


text:
UCLASS()
class USoundExporterOGG : public UExporter
{
public:
	GENERATED_BODY()

public:
	USoundExporterOGG(const FObjectInitializer& ObjectInitializer = FObjectInitializer());

	// Begin UExporter Interface
	virtual bool ExportBinary( UObject* Object, const TCHAR* Type, FArchive& Ar, FFeedbackContext* Warn, int32 FileIndex = 0, uint32 PortFlags=0 ) override;
	virtual bool SupportsObject(UObject* Object) const override;
	// End UExporter Interface
};


text:
package org.zstack.test.ldap;

import com.unboundid.ldap.sdk.LDAPException;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.zstack.core.cloudbus.CloudBus;
import org.zstack.core.componentloader.ComponentLoader;
import org.zstack.header.identity.AccountInventory;
import org.zstack.header.identity.SessionInventory;
import org.zstack.header.message.APIEvent;
import org.zstack.header.query.QueryCondition;
import org.zstack.ldap.*;
import org.zstack.portal.apimediator.PortalSystemTags;
import org.zstack.test.Api;
import org.zstack.test.ApiSender;
import org.zstack.test.ApiSenderException;
import org.zstack.test.DBUtil;
import org.zstack.test.deployer.Deployer;
import org.zstack.utils.Utils;
import org.zstack.utils.logging.CLogger;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.stream.Collectors;

public class TestLdapBindUnbindTLS {
    @Rule
    public ExpectedException thrown = ExpectedException.none();
    CLogger logger = Utils.getLogger(TestLdapBindUnbindTLS.class);
    Deployer deployer;
    Api api;
    ComponentLoader loader;
    CloudBus bus;
    SessionInventory session;
    LdapManager ldapManager;

    @Before
    public void setUp() throws Exception {
        DBUtil.reDeployDB();

        deployer = new Deployer("deployerXml/ldap/TestLdap.xml");
        deployer.addSpringConfig("LdapManagerImpl.xml");
        deployer.build();
        api = deployer.getApi();
        loader = deployer.getComponentLoader();
        ldapManager = loader.getComponent(LdapManager.class);
        bus = loader.getComponent(CloudBus.class);
        session = api.loginAsAdmin();
    }

    private void queryLdapServer() throws ApiSenderException {
        ApiSender sender = api.getApiSender();

        // query ldap server
        APIQueryLdapServerMsg msg12 = new APIQueryLdapServerMsg();
        msg12.setConditions(new ArrayList<QueryCondition>());
        msg12.setSession(session);
        APIQueryLdapServerReply reply12 = sender.call(msg12, APIQueryLdapServerReply.class);
        logger.debug(reply12.getInventories().stream().map(LdapServerInventory::getUrl).collect(Collectors.joining(", ")));
    }

    @Test
    public void test() throws ApiSenderException, LDAPException {
        ApiSender sender = api.getApiSender();
        String url = "ldap://172.20.12.176:389";
        String basedn = "dc=learnitguide,dc=net";
        String managerName = "cn=Manager,dc=learnitguide,dc=net";
        String managerPassword = "password";
        String uid = "star.guo";
        String password = "miao";
        // add ldap server
        APIAddLdapServerMsg msg13 = new APIAddLdapServerMsg();
        msg13.setName("miao");
        msg13.setDescription("miao desc");
        msg13.setUrl(url);
        msg13.setBase(basedn);
        msg13.setUsername("");
        msg13.setPassword("");
        msg13.setEncryption("TLS");
        msg13.setSession(session);
        APIAddLdapServerEvent evt13 = sender.send(msg13, APIAddLdapServerEvent.class);
        logger.debug(evt13.getInventory().getName());
        queryLdapServer();

        // test conn
        APIAddLdapServerMsg msg211 = new APIAddLdapServerMsg();
        msg211.setSystemTags(Arrays.asList(PortalSystemTags.VALIDATION_ONLY.getTagFormat()));
        msg211.setName("miao");
        msg211.setDescription("miao desc");
        msg211.setUrl(url);
        msg211.setBase(basedn);
        msg211.setUsername(managerName);
        msg211.setPassword(managerPassword);
        msg211.setEncryption("TLS");
        msg211.setSession(session);
        msg211.setTimeout(10);
        APIEvent evt211 = sender.send(msg211, APIEvent.class);
        Assert.assertTrue(evt211.isSuccess());

        // bind account
        AccountInventory ai1 = api.createAccount("ldapuser1", "hello-kitty");
        APICreateLdapBindingMsg msg2 = new APICreateLdapBindingMsg();
        msg2.setAccountUuid(ai1.getUuid());
        msg2.setLdapUid(uid);
        msg2.setSession(session);
        APICreateLdapBindingEvent evt2 = sender.send(msg2, APICreateLdapBindingEvent.class);
        logger.debug(evt2.getInventory().getUuid());

        // login with right password
        APILogInByLdapMsg msg3 = new APILogInByLdapMsg();
        msg3.setUid(uid);
        msg3.setPassword(password);
        msg3.setServiceId(bus.makeLocalServiceId(LdapConstant.SERVICE_ID));
        APILogInByLdapReply reply3 = sender.call(msg3, APILogInByLdapReply.class);
        logger.debug(reply3.getInventory().getAccountUuid());
        logger.debug(reply3.getAccountInventory().getName());

        // login with wrong password
        thrown.expect(ApiSenderException.class);
        //thrown.expectMessage("");

        APILogInByLdapMsg msg31 = new APILogInByLdapMsg();
        msg31.setUid(uid);
        msg31.setPassword("wrong password");
        msg31.setServiceId(bus.makeLocalServiceId(LdapConstant.SERVICE_ID));
        APILogInByLdapReply reply31 = sender.call(msg31, APILogInByLdapReply.class);
        logger.debug(reply31.getInventory().getAccountUuid());
        logger.debug(reply31.getAccountInventory().getName());

        //

    }
}


text:
from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('data_interfaces', '0001_initial'),
    ]

    operations = [
        migrations.AlterField(
            model_name='automaticupdaterulecriteria',
            name='match_type',
            field=models.CharField(max_length=10, choices=[('DAYS', 'DAYS'), ('EQUAL', 'EQUAL'), ('NOT_EQUAL', 'NOT_EQUAL')]),
            preserve_default=True,
        ),
    ]


text:
    <input type="radio" name="attr_tabs_radio" value="profile" checked="true" />

U

    <input type="radio" name="attr_tabs_radio" value="configuration" />

y

    <input type="radio" name="attr_tabs_radio" value="help" />

?

  <input type='hidden' class="tabcontrol" name='attr_selected_tab' value='profile' />

                Name

                <input name="attr_character_name" type="text" title="@{character_name}" />

                Age

                <input name="attr_age" type="number" title="@{age}" />

              Characteristics

                <fieldset class="repeating_characteristics">

                      <input name="attr_characteristic" type="text" data-i18n-placeholder="characteristic"
                        placeholder="Characteristic" />

                </fieldset>

              History

                <textarea name="attr_history" title="@{history}"></textarea>

                Defence

                    Passive

                    Equipped
                    <input type="text" readonly="true" name="attr_equip_total_passive_defence"
                      value="@{equip_total_passive_defence}" />

                    +

                    Mod
                    <input type="text" name="attr_passive_defence_mod" title="@{passive_defence_mod}" value="0" />

                    =

                      <input type="text" readonly="true" name="attr_passive_defence" title="@{passive_defence}"
                        value="0" />

                    Active

                    Passive
                    <input type="text" disabled="true" name="attr_passive_defence" title="@{passive_defence}"
                      value="@{passive_defence_mod} + @{equip_total_passive_defence}" />

                    +

                    Equipped
                    <input type="text" readonly="true" name="attr_equip_total_active_defence"
                      title="@{equip_total_active_defence}" />

                    +

                    Mod
                    <input type="text" name="attr_active_defence_mod" title="@{active_defence_mod}" value="0" />

                    =

                      <input type="text" readonly="true" name="attr_active_defence" title="@{active_defence}"
                        value="@{passive_defence} + @{active_defence_mod} + @{equip_total_active_defence}" />

                Energy

                  Max

                    <input type="text" name="attr_energy" readonly="true" title="@{energy}" value="0" />

                    <input type="text" name="attr_current_energy" title="@{current_energy}" value="0" />

                  Current

                  Skills

                  Level 1
                  Apprentice

                  Level 2
                  Practitioner

                  Level 3
                  Master

                    All tests
                      modifier

                      <input name="attr_all_mod" type="number" value="0" title="@{all_mod}" />

                    Points to spend

                      <input name="attr_points_to_spend" type="number" title="@{points_to_spend}" value="20" />

                Cost 1
                Bonus
                  +3

                Cost 3
                Bonus
                  +6

                Cost 7
                Bonus
                  +9

            <fieldset class="repeating_skills">

                        <button type="roll" class="roll-button" name="roll_skill_check" title="@{skill_check}"
                          value="&{template:main} {{charname=@{character_name}}} {{check=@{skill_name}}} {{target=[[?{@{difficulty} | @{easy}, 12 | @{intermediate}, 15 | @{difficult}, 18 | @{legendary}, 21 }]]}} {{result=[[ [[3d6cs>2cf<5]] + [[(@{skill_level}-@{endurance_penalty})*3]] + [[?{@{mod}|0} + @{all_mod} + @{skill_mod}]] ]]}} {{dice=$[[1]]}} {{skill_bonus=$[[2]]}} {{mod=$[[3]]}}"></button>
                        <input name="attr_skill_name" type="text" title="@{skill_name}" />

                  <input class="hidden-zero-input hidden-input" type="radio" name="attr_skill_level" checked="true"
                    value="0" />

                    <input class="hidden-input" type="radio" name="attr_skill_level" value="1" title="@{skill_level}" />
                    <input class="control-input" value="off" type="hidden" name="attr_skill_level_control1" />

                    <input class="hidden-input" type="radio" name="attr_skill_level" value="2" title="@{skill_level}" />
                    <input class="control-input" value="off" type="hidden" name="attr_skill_level_control2" />

                    <input class="hidden-input" type="radio" name="attr_skill_level" value="3" title="@{skill_level}" />
                    <input class="control-input" value="off" type="hidden" name="attr_skill_level_control3" />

                    <input type="checkbox" name="attr_showhide_checkbox" value="1" />

                <input class="toggle-checkbox" type="checkbox" name="attr_showhide_checkbox_invisible" value="1" />

                    Mod
                    <input type="number" name="attr_skill_mod" title="@{skill_mod}" value="0" />

                    Energy
                    <input type="checkbox" name="attr_skill_energy" title="@{skill_energy}" />

                  <textarea name="attr_skill_description" data-i18n-placeholder="description"
                    placeholder="Description"></textarea>

            </fieldset>

            <button type="roll" class="roll-button" name="roll_initiative" title="@{initiative}"
              value="&{template:main} {{charname=@{character_name}}} {{check=@{initiative_label}}} {{initiative=[[3d6cs>7cf<0 &{tracker}]]}}"></button>
            Initiative

            <button type="roll" class="roll-button" name="roll_untrained_skill" title="@{untrained_skill}"
              value="&{template:main} {{charname=@{character_name}}} {{check=@{untrained_skill_label}}} {{target=[[?{@{difficulty} | @{easy}, 12 | @{intermediate}, 15}]]}} {{result=[[ [[3d6cs>2cf<5]] + [[0]] + [[?{@{mod}|0} + @{all_mod}]] ]]}} {{dice=$[[1]]}} {{skill_bonus=$[[2]]}} {{mod=$[[3]]}}"></button>
            Untrained skill

              Physical condition

                    Endurance

                Max

                  <input name="attr_max_endurance" type="text" title="@{max_endurance}" value="10" />

                  <input name="attr_current_endurance" type="text" title="@{current_endurance}" value="10" />

                Current

                <input type="hidden" name="attr_endurance_penalty" value="0" />

                    Critical damage

              <input class="radio-zero" name="attr_critical_damage" type="radio" value="0" checked="true"
                title="@{critical_damage}" />
              <input class="critical-radio" name="attr_critical_damage" type="radio" value="1"
                title="@{critical_damage}" />
              <input class="critical-radio" name="attr_critical_damage" type="radio" value="2"
                title="@{critical_damage}" />
              <input class="critical-radio" name="attr_critical_damage" type="radio" value="3"
                title="@{critical_damage}" />
              <input class="critical-radio" name="attr_critical_damage" type="radio" value="4"
                title="@{critical_damage}" />
              <input class="critical-radio" name="attr_critical_damage" type="radio" value="5"
                title="@{critical_damage}" />

            Notes
            <textarea name="attr_notes" title="@{notes}"></textarea>

              Money & gear

            <fieldset class="repeating_gear">

                  <input name="attr_gear_name" type="text" title="@{gear_name}" />

                    <input type="checkbox" name="attr_showhide_checkbox" value="1" />

                <input class="toggle-checkbox" type="checkbox" name="attr_showhide_checkbox_invisible" value="1" />

                    Cost
                    <input type="number" name="attr_gear_cost" title="@{gear_cost}" value="0" />

                  <textarea name="attr_gear_description" data-i18n-placeholder="description" placeholder="Description"
                    title="@{gear_description}"></textarea>

            </fieldset>

                    Money

              <input name="attr_money" type="text" title="@{money}" value="1000" />

              Weapons & armors

                Damage

            <fieldset class="repeating_equip">

                  <input class="equipped" name="attr_equip_equipped" type="checkbox" title="@{equip_equipped}" />

                  <input name="attr_equip_name" type="text" title="@{equip_name}" />

                    <input type="number" name="attr_equip_damage" title="@{equip_damage}" value="0" />

                    <input type="checkbox" name="attr_showhide_checkbox" value="1" />

                <input class="toggle-checkbox" type="checkbox" name="attr_showhide_checkbox_invisible" value="1" />

                    Passive
                      defence bonus
                    Active
                      defence bonus

                    <input type="number" name="attr_equip_passive_defence_bonus" title="@{equip_passive_defence_bonus}"
                      value="0" />
                    <input type="number" name="attr_equip_active_defence_bonus" title="@{equip_active_defence_bonus}"
                      value="0" />

                    Reach
                    Cost

                    <input type="text" name="attr_equip_reach" title="@{equip_reach}" />
                    <input type="number" name="attr_equip_cost" title="@{equip_cost}" value="0" />

                  <textarea name="attr_equip_description" data-i18n-placeholder="description" placeholder="Description"
                    title="@{equip_description}"></textarea>

            </fieldset>

                    Defence totals

                Passive
                Active
                <input type="text" readonly="true" name="attr_equip_total_passive_defence"
                  title="{@equip_total_passive_defence}" value="0" />
                <input type="text" readonly="true" name="attr_equip_total_active_defence"
                  title="{@equip_total_active_defence}" value="0" />

          Settings

          Max defence value
          <input type="number" name="attr_max_defence_value" value="5" title="@{max_defence_value}">

          Help

How to use The Elephant and Macaw Banner RPG Roll20 Character Sheet

Thanks for playing The Elephant and Macaw Banner RPG! Please read this guide to
          understand how all the fields work on our Roll20 character sheet.

          Name,
          Characteristics,
          History -
          These fields should be filled in
            manually.

          Defence -
          The Active and Passive Defense values are
            calculated automatically, depending on what you have equipped in the Weapons & armors field (see below). If
            you need to add in other modifiers, use the "Mod" boxes. The max defense value is 5, but in exceptional
            circumstances, this value can be modified in the sheet´s configuration menu by clicking the settings button
            at the top of the sheet.

          Energy -
          The max energy is calculated automatically by
            selecting the "Energy" box related to the character´s primary power skill in the Skills field (see below).
            At the current time, we can´t calculate the energy spent automatically, so the current energy must be
            changed manually each time a power is used or energy is recovered.

          Skills -
          A new character begins with 20 points to
            distribute among skills, which can be distributed according to the suggested initial configuration in the
            rules or in any other way. Any time new learning points are earned, they can be added manually to the
            "Points to spend" field and spent on skills. For example, if the player has 1 point to spend and earns 2
            more learning points, simply change the value in "Points to spend" to 3.

          The "All tests modifier" field is used to apply a
            modifier to every skill test. This is useful for cases such as when the character receives a Blessing
            (applying a positive value in the field) or a disease (applying a negative value).

          The dropdown button on each skill serves three
            purposes:

              Using the Mod field to add a modifier specific
                to that skill. For example, if the player is using a weapon that gives +2 to the Impact weapons skill,
                that bonus should be put into the Mod field. The skill´s level bonus is added automatically to tests and
                should not be applied to the Mod field.

              If the skill is one of the three base power
                skills, Faith, Breath or Ifá (or something equivalent in the expanded rules), the "Energy" box should be
                selected.

              A description can be added in the description
                box, if desired.

          If you need to delete a skill, click on the padlock icon at the bottom of the Skills field, then choose the skill for removal.

          Rolling skill tests:

          Clicking the die icon next to each skill will apply a test. The player will be asked to choose the feat level (easy, intermediate, difficult, legendary) and a final modifier value, which can be used to apply effects like subtracting the target´s defense on an attack.

          The result will be shown in the chat window as the sum of three values:

          The 3d6 roll + the skill´s level bonus + other modifiers

          Other modifiers include:

              modifier chosen when rolling,

              the "Modify all skills" value and

              the Mod value set for the individual skill.

          For example: A character receives a Bless +2 during a battle, so the player should put 2 in the All tests modifier field. The character is using an excepcional rapier that gives +1 to Fencing, which should be represented as 1 in the skill´s Mod field. The player decides to make a normal melee attack (easy feat) on a creature with an Active Defense of 4. So after clicking the die beside Fencing for the test, the player should choose an easy feat and place -4 in the Mod field to subtract the creature´s defense. In the chat window, the "Mods" applied to the test should appear as -1, representing -4 + 2 + 1 for the three modifiers.

          Initiative -
          Can be used for an initiative check.

          Untrained skill -
          Can be used for level 0 tests against easy or intermediate feats, as explained in the rulebook.

          Physical Condition -
          Endurance, Critical damage and Notes must be filled in manually.

          Money & Gear -
          These fields should be applied manually and do not affect anything else on the sheet.

          Weapons & Armors -
          It is important to fill in any Active or Passive Defense bonuses related to each piece of equipment. For example, a character with a rapier and level 2 in Fencing should fill in 2 in the Active defense bonus field for that item. The player must also be careful to always select only the current weapon in use. Otherwise, the defense bonus will be calculated incorrectly.

          The damage fields and description are for reference only.

          Credits:

          Character Sheet by Christopher Kastensmidt and Filipe Borin
            Roll20 implementation by Daniel Tschiedel

    This is a character sheet for The Elephant and Macaw Banner RPG, (c) 2017 Christopher
      Kastensmidt. All rights reserved.

<rolltemplate class="sheet-rolltemplate-main">

      {{charname}}

    {{#check}}

      Check
      {{check}}

    {{/check}}

    {{#result}}

        Difficulty
        {{target}}

        Skill bonus
        {{skill_bonus}}

        Mods
        {{mod}}

      {{dice}} + {{skill_bonus}} + {{mod}} = {{result}}

      Result
      {{#^rollLess() result target}}
      Success
      {{/^rollLess() result target}}

      {{#rollLess() result target}}
      Failure
      {{/rollLess() result target}}

      {{#rollTotal() dice 3}}
      Epic failure!
      {{/rollTotal() dice 3}}

      {{#rollTotal() dice 18}}
      Epic success!
      {{/rollTotal() dice 18}}

    {{/result}}

    {{#initiative}}

      {{initiative}}

    {{/initiative}}

</rolltemplate>

  Mod
  Easy
  Intermediate
  Difficult
  Legendary


text:
FactoryGirl.define do
  factory :user do
    provider "MyString"
    uid "MyString"
    name "MyString"
    email "MyString"
    oauth_token "MyString"
    oauth_expires_at "2014-06-09 18:44:56"
  end
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Blog.Business;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.EntityFrameworkCore;
using Blog.Data;
using Microsoft.AspNetCore.Http;

namespace Blog
{
    public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddRazorPages();

            services.AddServerSideBlazor();

            services.AddDbContext<BlogContext>(options =>
                    options.UseInMemoryDatabase("blog"));

            services.AddScoped<BlogManager>();
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseStaticFiles();
            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapRazorPages();

                endpoints.MapControllers();
            });

        }
    }
}