text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>{{ page.title }}</title>

    <link rel="stylesheet" href="{{ site.baseurl }}/assets/css/normalize.css">
    <link rel="stylesheet" href="{{ site.baseurl }}/assets/css/sakura.css" async>
    <link rel="stylesheet" href="{{ site.baseurl }}/assets/css/custom.css" async>
    <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon">

            {{ site.title }} ::
            blog
            about

        {{ content }}

    {% include analytics.html %}

redpajama_set_name: RedPajamaGithub


text:
"""Implementations of locale abstract base class objects."""
# pylint: disable=invalid-name
#     Method names comply with OSID specification.
# pylint: disable=no-init
#     Abstract classes do not define __init__.
# pylint: disable=too-few-public-methods
#     Some interfaces are specified as 'markers' and include no methods.
# pylint: disable=too-many-public-methods
#     Number of methods are defined in specification
# pylint: disable=too-many-ancestors
#     Inheritance defined in specification
# pylint: disable=too-many-arguments
#     Argument signature defined in specification.
# pylint: disable=duplicate-code
#     All apparent duplicates have been inspected. They aren't.
import abc

class CalendarInfo:
    """This interface defines methods to examine a calendar.

    A calendar is organized into "years," "months," and "days." A
    calendar system may offer a diffreent designation for these
    divisions which may or may not vary in duration.

    """
    __metaclass__ = abc.ABCMeta

    @abc.abstractmethod
    def get_calendar_type(self):
        """Gets the calendar type.

        :return: the calendar type
        :rtype: ``osid.type.Type``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.type.Type

    calendar_type = property(fget=get_calendar_type)

    @abc.abstractmethod
    def get_display_name(self):
        """Gets the display name for this calendar.

        :return: the display name
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    display_name = property(fget=get_display_name)

    @abc.abstractmethod
    def get_description(self):
        """Gets a description of this calendar.

        :return: the description
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    description = property(fget=get_description)

    @abc.abstractmethod
    def get_common_era_name(self):
        """Gets the string for the common era in which years are positive.

        :return: the common era label
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    common_era_name = property(fget=get_common_era_name)

    @abc.abstractmethod
    def get_common_era_abbrev(self):
        """Gets the abbreviation for the common era in which years are positive.

        :return: the common era label
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    common_era_abbrev = property(fget=get_common_era_abbrev)

    @abc.abstractmethod
    def get_before_common_era_name(self):
        """Gets the string for before the common era in which years are negative.

        :return: the before common era label
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    before_common_era_name = property(fget=get_before_common_era_name)

    @abc.abstractmethod
    def get_before_common_era_abbrev(self):
        """Gets the abbreviation for before the common era in which years are negative.

        :return: the before common era label
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    before_common_era_abbrev = property(fget=get_before_common_era_abbrev)

    @abc.abstractmethod
    def get_first_year_in_common_era(self):
        """Gets the year number for the first year.

        :return: the first year
        :rtype: ``integer``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # integer

    first_year_in_common_era = property(fget=get_first_year_in_common_era)

    @abc.abstractmethod
    def get_last_year_before_common_era(self):
        """Gets the year number for the year before the common era.

        :return: the last bce year
        :rtype: ``integer``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # integer

    last_year_before_common_era = property(fget=get_last_year_before_common_era)

    @abc.abstractmethod
    def get_year_name(self):
        """Gets the display name for a calendar "year.

        "

        :return: the name
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    year_name = property(fget=get_year_name)

    @abc.abstractmethod
    def get_month_name(self):
        """Gets the display name for a calendar "month.

        "

        :return: the name
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    month_name = property(fget=get_month_name)

    @abc.abstractmethod
    def has_variable_months(self):
        """Tests if this calendar has a variable number of months in a year.

        :return: ``true`` if the number of months varies, ``false`` if the number of months is constant
        :rtype: ``boolean``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # boolean

    @abc.abstractmethod
    def get_num_months(self):
        """Gets the number of months of the year.

        For a variable month calendar, the number of all defined months
        are returned. If there are no "months" in this calendar system
        then this value may be zero.

        :return: the number of months
        :rtype: ``cardinal``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # cardinal

    num_months = property(fget=get_num_months)

    @abc.abstractmethod
    def get_num_months_for_year(self, year):
        """Gets the number of months in the given year.

        :param year: a year
        :type year: ``integer``
        :return: the number of months
        :rtype: ``cardinal``
        :raise: ``IllegalState`` -- ``year`` is greater than ``get_last_year_before_common_era()`` and less then ``get_first_year_in_common_era()``
        :raise: ``OperationFailed`` -- unable to complete request

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # cardinal

    @abc.abstractmethod
    def get_months(self):
        """Gets the months of the year in order of the calendar.

        For a variable month calendar, all defined months are returned.
        If there are no "months" in this calendar system then the list
        may be empty.

        :return: the months
        :rtype: ``osid.locale.CalendarUnit``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.CalendarUnit

    months = property(fget=get_months)

    @abc.abstractmethod
    def get_months_for_year(self, year):
        """Gets the months of the year in order of the calendar.

        :param year: a year
        :type year: ``integer``
        :return: the months
        :rtype: ``osid.locale.CalendarUnit``
        :raise: ``IllegalState`` -- ``year`` is greater than ``get_last_year_before_common_era()`` and less then ``get_first_year_in_common_era()``
        :raise: ``OperationFailed`` -- unable to complete request

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.CalendarUnit

    @abc.abstractmethod
    def get_day_name(self):
        """Gets the display name for a calendar "day.

        "

        :return: the name
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    day_name = property(fget=get_day_name)

    @abc.abstractmethod
    def has_variable_days(self):
        """Tests if this calendar has a variable number of days in a month.

        :return: ``true`` if the number of days per month varies, ``false`` if the number of days is constant
        :rtype: ``boolean``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # boolean

    @abc.abstractmethod
    def get_num_days(self):
        """Gets the number of days in a year.

        For a variable day calendar, the number of all defined days are
        returned. If there are no "days" in this calendar system then
        this value may be zero. If there are no "months" defined then
        the number of days is the number of days in a year.

        :return: the number of days
        :rtype: ``cardinal``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # cardinal

    num_days = property(fget=get_num_days)

    @abc.abstractmethod
    def get_num_days_for_month(self, year, month):
        """Gets the number of days in the given month.

        :param year: a year
        :type year: ``integer``
        :param month: a ``DateTime`` month code
        :type month: ``cardinal``
        :return: the number of days
        :rtype: ``cardinal``
        :raise: ``IllegalState`` -- ``year`` is greater than ``get_last_year_before_common_era()`` and less then ``get_first_year_in_common_era()`` , or ``month`` is greater than ``get_months_for_year(year)``
        :raise: ``OperationFailed`` -- unable to complete request

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # cardinal

    @abc.abstractmethod
    def get_days(self):
        """Gets the days of the month in order of the calendar.

        For a variable day calendar, all defined days are returned. If
        there are no "days" in this time system then this value may be
        zero. If there are no "months" defined then the number of days
        applies to the entire year.

        :return: the days
        :rtype: ``osid.locale.CalendarUnit``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.CalendarUnit

    days = property(fget=get_days)

    @abc.abstractmethod
    def get_days_for_month(self, year, month):
        """Gets the days of the given month in order of the calendar.

        :param year: a year
        :type year: ``integer``
        :param month: a ``DateTime`` month code
        :type month: ``cardinal``
        :return: the days
        :rtype: ``osid.locale.CalendarUnit``
        :raise: ``IllegalState`` -- ``year`` is greater than ``get_last_year_before_common_era()`` and less then ``get_first_year_in_common_era()`` , or ``month`` is greater than or equal to than ``get_months_for_year(year)``
        :raise: ``OperationFailed`` -- unable to complete request

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.CalendarUnit

    @abc.abstractmethod
    def get_first_day_of_year(self):
        """Gets the first day of the calendar year.

        :return: the first day of the year
        :rtype: ``osid.calendaring.DateTime``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.calendaring.DateTime

    first_day_of_year = property(fget=get_first_day_of_year)

    @abc.abstractmethod
    def get_end_of_days_name(self):
        """Gets the display name for the end of the calendar.

        :return: the name
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    end_of_days_name = property(fget=get_end_of_days_name)

    @abc.abstractmethod
    def get_origin(self):
        """Gets the start of the "common era" for this calendar.

        :return: start of the calendar
        :rtype: ``osid.calendaring.DateTime``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.calendaring.DateTime

    origin = property(fget=get_origin)

    @abc.abstractmethod
    def get_end_of_days(self):
        """Gets the end of the world as specified by this calendar.

        :return: end of days
        :rtype: ``osid.calendaring.DateTime``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.calendaring.DateTime

    end_of_days = property(fget=get_end_of_days)

    @abc.abstractmethod
    def get_weekdays(self):
        """Gets the days of the week in order of the calendar.

        :return: the week days
        :rtype: ``osid.locale.CalendarUnit``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.CalendarUnit

    weekdays = property(fget=get_weekdays)

class TimeInfo:
    """This interface defines methods to examine a time.

    Time is organized intro "hours," "minutes," and "seconds." A time
    system may offer a different designation for these divisions which
    may or may not vary in duration.

    """
    __metaclass__ = abc.ABCMeta

    @abc.abstractmethod
    def get_time_type(self):
        """Gets the time type.

        :return: the time type
        :rtype: ``osid.type.Type``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.type.Type

    time_type = property(fget=get_time_type)

    @abc.abstractmethod
    def get_display_name(self):
        """Gets the display name for this time system.

        :return: the display name
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    display_name = property(fget=get_display_name)

    @abc.abstractmethod
    def get_display_label(self):
        """Gets a short label for this time system.

        :return: the label
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    display_label = property(fget=get_display_label)

    @abc.abstractmethod
    def get_description(self):
        """Gets a description of this time system.

        :return: the description
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    description = property(fget=get_description)

    @abc.abstractmethod
    def get_hour_name(self):
        """Gets the display name for "hours.

        "

        :return: the name
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    hour_name = property(fget=get_hour_name)

    @abc.abstractmethod
    def get_hour_abbrev(self):
        """Gets the abbreviation for "hours.

        "

        :return: the abbreviation
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    hour_abbrev = property(fget=get_hour_abbrev)

    @abc.abstractmethod
    def get_hour_initial(self):
        """Gets the initial for "hours.

        "

        :return: the initial
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    hour_initial = property(fget=get_hour_initial)

    @abc.abstractmethod
    def has_variable_hours(self):
        """Tests if this time system has a variable number of hours in a day.

        :return: ``true`` if the number of hours per day varies, ``false`` if the number of hours per day is constant
        :rtype: ``boolean``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # boolean

    @abc.abstractmethod
    def get_num_hours(self):
        """Gets the number of hours in a day.

        For a variable hour time system, the number of hours defined is
        returned. If there are no "hours" in this time system then this
        value may be zero.

        :return: the number of hours
        :rtype: ``cardinal``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # cardinal

    num_hours = property(fget=get_num_hours)

    @abc.abstractmethod
    def get_num_hours_for_day(self, year, month, day):
        """Gets the number of hours for a given day.

        :param year: a year
        :type year: ``integer``
        :param month: a ``DateTime`` month code
        :type month: ``cardinal``
        :param day: a ``DateTime`` day code
        :type day: ``cardinal``
        :return: the number of hours
        :rtype: ``cardinal``
        :raise: ``IllegalState`` -- ``year`` is greater than ``CalendarInfo.getLastYearBeforeCommonEra()`` and less then ``CalendarInfo.getFirstYearInCommonEra()`` , or ``month`` is greater than or equal to
``CalendarInfo.getNumMonthsForYear(year)`` , or ``day`` is greater than or equal to ``CalendarInfo.getDaysInMonth(year, month)``
        :raise: ``OperationFailed`` -- unable to complete request

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # cardinal

    @abc.abstractmethod
    def get_minute_name(self):
        """Gets the display name for "minutes.

        "

        :return: the name
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    minute_name = property(fget=get_minute_name)

    @abc.abstractmethod
    def get_minute_abbrev(self):
        """Gets the abbreviation for "minutes.

        "

        :return: the abbreviation
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    minute_abbrev = property(fget=get_minute_abbrev)

    @abc.abstractmethod
    def get_minute_initial(self):
        """Gets the initial for "minutes.

        "

        :return: the initial
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    minute_initial = property(fget=get_minute_initial)

    @abc.abstractmethod
    def has_variable_minutes(self):
        """Tests if this time system has a variable number of minutes in an hour.

        :return: ``true`` if the number of minutes per hour varies, ``false`` if the number of minutes per hour is constant
        :rtype: ``boolean``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # boolean

    @abc.abstractmethod
    def get_num_minutes(self):
        """Gets the number of minutes in an hour.

        For a variable minute time system, the number of minutes defined
        is returned. If there are no "minutes" in this time system then
        this value may be zero. If there are no "hours" defined then the
        number of minutes is the number of minutes in a day.

        :return: the number of minutes
        :rtype: ``cardinal``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # cardinal

    num_minutes = property(fget=get_num_minutes)

    @abc.abstractmethod
    def get_num_minutes_for_hour(self, year, month, day, hour):
        """Gets the minutes for a given hour.

        :param year: a year
        :type year: ``integer``
        :param month: a ``DateTime`` month code
        :type month: ``cardinal``
        :param day: a ``DateTime`` day code
        :type day: ``cardinal``
        :param hour: an hour
        :type hour: ``cardinal``
        :return: the number of minutes
        :rtype: ``cardinal``
        :raise: ``IllegalState`` -- ``year`` is greater than ``CalendarInfo.getLastYearBeforeCommonEra()`` and less then ``CalendarInfo.getFirstYearInCommonEra(),`` or ``month`` is greater than or equal to
``CalendarInfo.getNumMonthsForYear(year)`` , or ``day`` is greater than or equal to ``CalendarInfo.getDaysInMonth(year, month)`` , or ``hour`` is greater than or equal to ``get_num_hours_in_day(year,
month, day)``
        :raise: ``OperationFailed`` -- unable to complete request

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # cardinal

    @abc.abstractmethod
    def get_second_name(self):
        """Gets the display name for "seconds.

        "

        :return: the name
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    second_name = property(fget=get_second_name)

    @abc.abstractmethod
    def get_second_abbrev(self):
        """Gets the abbreviation for "seconds.

        "

        :return: the abbreviation
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    second_abbrev = property(fget=get_second_abbrev)

    @abc.abstractmethod
    def get_second_initial(self):
        """Gets the initial for "seconds.

        "

        :return: the initial
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    second_initial = property(fget=get_second_initial)

    @abc.abstractmethod
    def has_variable_seconds(self):
        """Tests if this time system has a variable number of seconds in a minute.

        :return: ``true`` if the number of seconds per minute varies, ``false`` if the number of seconds per minute is constant
        :rtype: ``boolean``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # boolean

    @abc.abstractmethod
    def get_num_seconds(self):
        """Gets the number of seconds in a minute.

        For a variable second time system, the number of seconds defined
        is returned. If there are no "seconds" in this time system then
        this value may be zero. If there are no "minutes" defined then
        the number of seconds is the number of seconds in an hour.

        :return: the number of seconds
        :rtype: ``cardinal``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # cardinal

    num_seconds = property(fget=get_num_seconds)

    @abc.abstractmethod
    def get_num_seconds_for_minute(self, year, month, day, hour, minute):
        """Gets the seconds for a given minute.

        :param year: a year
        :type year: ``integer``
        :param month: a ``DateTime`` month code
        :type month: ``cardinal``
        :param day: a ``DateTime`` day code
        :type day: ``cardinal``
        :param hour: an hour
        :type hour: ``cardinal``
        :param minute: a minute
        :type minute: ``cardinal``
        :return: the number of seconds
        :rtype: ``cardinal``
        :raise: ``IllegalState`` -- ``year`` is greater than ``get_last_year_before_common_era()`` and less then ``get_first_year_in_common_era()`` , or ``month`` is greater than or equal to ``CalendarInfo.getNumMonthsForYear(year)`` ,
or ``day`` is greater than or equal to ``CalendarInfo.getDaysInMonth(year, month)`` , or ``hour`` is greater than or equal to ``get_num_hours_in_day(year, month, day)`` , or ``minute`` is greater than
or equal to ``get_num_minutes_inhour(year, month, day, hour)``
        :raise: ``OperationFailed`` -- unable to complete request

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # cardinal

class CalendarUnit:
    """A description of a calendar unit."""
    __metaclass__ = abc.ABCMeta

    @abc.abstractmethod
    def get_name(self):
        """Gets the full name of this unit.

        :return: the name
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    name = property(fget=get_name)

    @abc.abstractmethod
    def get_abbrev3(self):
        """Gets a 3-letter abbreviation for this unit.

        :return: the abbreviation
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    abbrev3 = property(fget=get_abbrev3)

    @abc.abstractmethod
    def get_abbrev2(self):
        """Gets a 2-letter abbreviation for this unit.

        :return: the abbreviation
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    abbrev2 = property(fget=get_abbrev2)

    @abc.abstractmethod
    def get_initial(self):
        """Gets a single letter abbreviation for this unit.

        :return: the initial
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    initial = property(fget=get_initial)

    @abc.abstractmethod
    def get_date_time_code(self):
        """Gets the number of this unit used in ``DateTime``.

        :return: the code
        :rtype: ``cardinal``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # cardinal

    date_time_code = property(fget=get_date_time_code)

    @abc.abstractmethod
    def get_description(self):
        """Gets a description of this unit.

        :return: the description
        :rtype: ``osid.locale.DisplayText``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.DisplayText

    description = property(fget=get_description)

class Locale:
    """A locale is a collection of types.

    ``Locale`` defines a set of types that together define the
    formatting, language, calendaring, and currency for a locale or
    culture.

    """
    __metaclass__ = abc.ABCMeta

    @abc.abstractmethod
    def get_language_type(self):
        """Gets the language ``Type``.

        :return: the language type
        :rtype: ``osid.type.Type``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.type.Type

    language_type = property(fget=get_language_type)

    @abc.abstractmethod
    def get_script_type(self):
        """Gets the script ``Type``.

        :return: the script type
        :rtype: ``osid.type.Type``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.type.Type

    script_type = property(fget=get_script_type)

    @abc.abstractmethod
    def get_calendar_type(self):
        """Gets the calendar ``Type``.

        :return: the calendar type
        :rtype: ``osid.type.Type``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.type.Type

    calendar_type = property(fget=get_calendar_type)

    @abc.abstractmethod
    def get_time_type(self):
        """Gets the time ``Type``.

        :return: the time type
        :rtype: ``osid.type.Type``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.type.Type

    time_type = property(fget=get_time_type)

    @abc.abstractmethod
    def get_currency_type(self):
        """Gets the currency ``Type``.

        :return: the currency type
        :rtype: ``osid.type.Type``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.type.Type

    currency_type = property(fget=get_currency_type)

    @abc.abstractmethod
    def get_unit_system_type(self):
        """Gets the unit system ``Type``.

        :return: the unit system type
        :rtype: ``osid.type.Type``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.type.Type

    unit_system_type = property(fget=get_unit_system_type)

    @abc.abstractmethod
    def get_numeric_format_type(self):
        """Gets the numeric format ``Type``.

        :return: the numeric format type
        :rtype: ``osid.type.Type``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.type.Type

    numeric_format_type = property(fget=get_numeric_format_type)

    @abc.abstractmethod
    def get_calendar_format_type(self):
        """Gets the calendar format ``Type``.

        :return: the calendar format type
        :rtype: ``osid.type.Type``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.type.Type

    calendar_format_type = property(fget=get_calendar_format_type)

    @abc.abstractmethod
    def get_time_format_type(self):
        """Gets the time format ``Type``.

        :return: the time format type
        :rtype: ``osid.type.Type``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.type.Type

    time_format_type = property(fget=get_time_format_type)

    @abc.abstractmethod
    def get_currency_format_type(self):
        """Gets the currency format ``Type``.

        :return: the currency format type
        :rtype: ``osid.type.Type``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.type.Type

    currency_format_type = property(fget=get_currency_format_type)

    @abc.abstractmethod
    def get_coordinate_format_type(self):
        """Gets the coordinate format ``Type``.

        :return: the coordinate format type
        :rtype: ``osid.type.Type``

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.type.Type

    coordinate_format_type = property(fget=get_coordinate_format_type)

class LocaleList:
    """Like all ``OsidLists,``  ``LocaleList`` provides a means for accessing ``Locale`` elements sequentially either one at a time or many at a time.

    Examples: while (ll.hasNext()) { Locale locale = ll.getNextLocale();
    }

    or
      while (ll.hasNext()) {
           Locale[] locales = ll.getNextLocales(ll.available());
      }

    """
    __metaclass__ = abc.ABCMeta

    @abc.abstractmethod
    def get_next_locale(self):
        """Gets the next ``Locale`` in this list.

        :return: the next ``Locale`` in this list. The ``has_next()`` method should be used to test that a next ``Locale`` is available before calling this method.
        :rtype: ``osid.locale.Locale``
        :raise: ``IllegalState`` -- no more elements available in this list
        :raise: ``OperationFailed`` -- unable to complete request

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.Locale

    next_locale = property(fget=get_next_locale)

    @abc.abstractmethod
    def get_next_locales(self, n):
        """Gets the next set of ``Locale`` elements in this list.

        The specified amount must be less than or equal to the return
        from ``available()``.

        :param n: the number of ``Locale`` elements requested which must be less than or equal to ``available()``
        :type n: ``cardinal``
        :return: an array of ``Locale`` elements.The length of the array is less than or equal to the number specified.
        :rtype: ``osid.locale.Locale``
        :raise: ``IllegalState`` -- no more elements available in this list
        :raise: ``OperationFailed`` -- unable to complete request

        *compliance: mandatory -- This method must be implemented.*

        """
        return  # osid.locale.Locale


text:
package org.apache.aries.proxy.itests;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.ops4j.pax.exam.CoreOptions.equinox;
import static org.apache.aries.itest.ExtraOptions.*;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.concurrent.Callable;

import org.apache.aries.itest.AbstractIntegrationTest;
import org.apache.aries.proxy.FinalModifierException;
import org.apache.aries.proxy.ProxyManager;
import org.apache.aries.proxy.UnableToProxyException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.CoreOptions;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.container.def.PaxRunnerOptions;
import org.ops4j.pax.exam.container.def.options.CleanCachesOption;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;
import static org.ops4j.pax.exam.CoreOptions.waitForFrameworkStartup;
import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.vmOption;

/**
 * This test runs the basic proxy tests for the proxy bundles (not the uber bundle).
 * It needs to be a separate class from the uber-bundle test, since equinox configuration
 * doesn't seem to be cleaned properly within the same test class, so we run with the
 * uber-bundle, which means we test nothing.
 *
 */
@RunWith(JUnit4TestRunner.class)
public class BasicProxyBundlesTest extends AbstractBasicProxyTest
{
  @org.ops4j.pax.exam.junit.Configuration
  public static Option[] configuration35IndividualBundles() {
      return testOptions(
          generalOptions(),
          proxyBundles(),
          equinox35()
      );
  }

  @org.ops4j.pax.exam.junit.Configuration
  public static Option[] configuration37IndividualBundles() {
      return testOptions(
          generalOptions(),
          proxyBundles(),
          equinox37()
      );
  }
}


text:
class PasswordResetsController < ApplicationController
  before_action :get_user,         only: [:edit, :update]
  before_action :valid_user,       only: [:edit, :update]
  before_action :check_expiration, only: [:edit, :update]

  def new
    @user = User.new
  end

  def create
    @user = User.find_by_email(params[:password_reset][:email].downcase)
    if @user
      if @user.provider?
        @user.send_account_info_email
      else
        @user.create_password_reset_token
        @user.send_password_reset_email
      end
      flash[:info] = "Email was sent with instructions."
      redirect_to root_url
    else
      flash[:danger] = "Email not found."
      redirect_to new_password_reset_url
    end
  end

  def edit
  end

  def update
    if params[:user][:password].empty?
      @user.errors.add(:password, "can't be empty")
      render 'edit'
    elsif @user.update_attributes(user_params)
      log_in @user
      flash[:success] = "Password has been reset."
      redirect_to root_url
    else
      render 'edit'
    end
  end

  private

    def user_params
      params.require(:user).permit(:password, :password_confirmation)
    end

    def get_user
      @user = User.find_by_email(params[:email])
    end

    def valid_user
      unless @user && @user.activated? && (@user.password_reset_token == params[:id])
        msg = "Your account was not activated."
        msg += " Check your email for activation link."
        flash[:danger] = msg
        redirect_to root_url
      end
    end

    def check_expiration
      if @user.password_reset_token_expired?
        flash[:danger] = "Password reset has expired."
        redirect_to new_password_reset_url
      end
    end
end


text:
<?php
$CI =& get_instance();
?>
<form name="myaccount-frm" id="myaccount-frm" target="integration_asynchronous" class="validation-frm">

Display :(*)

                    <input
                        type="text"
                        class="form-control validate[required,minSize[4],maxSize[50]]"
                        placeholder=""
                        name="name"
                        value="<?php echo $CI->session->userdata('dasbboard_user')->ause_name ; ?>" >

Email :(*)

                    <input
                        type="text"
                        class="form-control validate[required,custom[email]]"
                        placeholder=""
                        name="email"
                        value="<?php echo $CI->session->userdata('dasbboard_user')->ause_email ; ?>" >

Avatar :(*)

                        <input type="text"
                            class="form-control"
                            data-putto="#frm-err-avatar"
                            name="avatar"
                            id="avatar"
                            value="<?php echo $CI->session->userdata('dasbboard_user')->ause_picture ; ?>"
                            >

Current Password :(*)

                    <input
                        type="password"
                        class="form-control validate[minSize[4],maxSize[50]]"
                        placeholder=""
                        name="oldpassword"
                        value="" >

New Password :(*)

                    <input
                        type="password" id="password"
                        class="form-control validate[minSize[4],maxSize[50]]"
                        placeholder=""
                        name="password"
                        value="" >

Confirm Password :(*)

                    <input
                        type="password"
                        class="form-control validate[equals[password]]"
                        placeholder=""
                        name="confirmpassword"
                        value="" >

</form>


text:
namespace Manisero.AutoRegistrar.Tests.Core.TestsHelpers.Scenario.CodeBase.Queries._Impl
{
	public class PureQuery : IPureQuery
	{
	}
}


text:
import numpy as np

from SimpleGP.simplegp import GP
from SimpleGP.gppde import GPPDE

class Generational(GP):
    def __init__(self, **kwargs):
        super(Generational, self).__init__(**kwargs)
        self._ngens = 1
        self._nkills = 0

    def create_population(self):
        super(Generational, self).create_population()
        self._sons_p = np.empty(self.popsize, dtype=np.object)
        self._sons_p_constants = np.empty(self.popsize, dtype=np.object)

    def kill_ind(self, kill, son):
        nk = self._nkills
        self._sons_p[nk] = son
        self._sons_p_constants[nk] = self._ind_generated_c
        self._nkills += 1
        if self._nkills == (self.popsize - 1):
            self._ngens += 1
            self._nkills = 0
            self.merge_population()

    def merge_population(self):
        m = np.ones(self.popsize, dtype=np.bool)
        m[self.best] = False
        self._fitness[m] = -np.inf
        for k, v in enumerate(np.where(m)[0]):
            self._p[v] = self._sons_p[k].copy()
            self._p_constants[v] = self._sons_p_constants[k].copy()

class GenerationalPDE(Generational, GPPDE):
    def __init__(self, **kwargs):
        super(GenerationalPDE, self).__init__(**kwargs)
        self._doing_mutation = False

    def kill_ind(self, *args):
        if self._doing_mutation:
            GPPDE.kill_ind(self, *args)
        else:
            super(GenerationalPDE, self).kill_ind(*args)

    def mutation(self, *args):
        self._doing_mutation = True
        r = super(GenerationalPDE, self).mutation(*args)
        self._doing_mutation = False
        return r


text:
from __future__ import unicode_literals

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion

class Migration(migrations.Migration):

    dependencies = [
        ('coupons', '0001_initial'),
        ('orders', '0001_initial'),
    ]

    operations = [
        migrations.AddField(
            model_name='order',
            name='coupon',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='orders', to='coupons.Coupon'),
        ),
        migrations.AddField(
            model_name='order',
            name='discount',
            field=models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(100)]),
        ),
    ]


text:
@charset "utf-8";
html {height:100%;background:#fff; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; -webkit-font-smoothing:antialiased; overflow-y:scroll;}
body {margin:0;padding:0;color:#404040;font:12px/20px Microsoft YaHei, verdana;}
h1, h2, h3, h4, h5, h6, p, figure, fieldset, form, dl, dt, dd {margin:0; padding:0;}
table {border-collapse:collapse;border-spacing:0;}
img {border:0; vertical-align:middle; -ms-interpolation-mode: bicubic;}

/* hn */
h1 {font-size:16px; line-height:36px;}
h2 {font-size:14px; line-height:30px;}
h3 {line-height:24px;}
h3, h4, h5, h6 {font-size:12px;}
/* ul ol dl */
ul, li, ol, li {margin:0;padding:0;list-style:none outside none;}
pre {margin:0;white-space:pre-wrap; white-space:-moz-pre-wrap!important; white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;}

/* form */
button, input, select, textarea {font-size:100%;font-family:Microsoft YaHei;margin: 0;outline:0 none;vertical-align:baseline;*vertical-align:middle;}
textarea {overflow:auto;vertical-align:top;resize:none;}
button, input {line-height:normal;}
button, html input[type="button"], input[type="reset"], input[type="submit"], .submit-btn {-webkit-appearance:button;cursor:pointer;*overflow: visible;}
button[disabled], input[disabled], .disable {cursor: default;}
input[type="checkbox"], input[type="radio"], .form-radio, .form-checkbox {box-sizing: border-box;padding: 0;*height:13px;*width:13px;}
legend {border:0;padding:0;white-space: normal;*margin-left: -7px;}
button::-moz-focus-inner, input::-moz-focus-inner {border:0;padding:0;}

/* css3 & html5 */
main {display:block;}
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section, summary {display: block;}
audio, canvas, video {display: inline-block;*display: inline;*zoom: 1;}
audio:not([controls]) {display: none;height: 0;}
nav ul, nav ol {list-style: none;list-style-image: none;}
input[type="search"] {-webkit-appearance: textfield;-moz-box-sizing: content-box;-webkit-box-sizing: content-box;box-sizing: content-box;}
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration {-webkit-appearance: none;}

/* -------------------------------------------------
 * public style
 * -------------------------------------------------
*/
.clearfix:before, .clearfix:after {content: ""; display:table;}
.clearfix:after {clear:both;}
.clearfix {zoom:1;}
.pull-left {float:left;}
.pull-right {float:right;}

/*link style*/
a {text-decoration:none; outline:none; color:#4b4b4b;}
a:active,a:focus,a:visited {outline:none;}
a:hover {text-decoration:none; color:#06a9ef;}

.a_ a {text-decoration:underline;}
.ahover_ a:hover {text-decoration:underline;}
.hover-underline {text-decoration:underline;}
.link-blue a {color:#06a9ef;}
.link-blue a:hover {text-decoration:underline; color:#06a9ef;}
.link-pink a {color:#fb6964;}
.link-pink a:hover {text-decoration:underline;}
.link-ash8 a {color:#888;}
.link-ash8 a:hover {color:#06a9ef;}
.txt-ellipsis {overflow:hidden; white-space:nowrap; text-overflow:ellipsis;}
/*font style*/
i {font-style:normal;}
.txt-blue {color:#00a2e5;}
.txt-pink {color:#fb6964;}
.txt-danger {color:#e03233;}

.txt-ash8 {color:#888;}
.font14 {font-size:14px; font-weight:normal;}
.align-center {text-align:center;}
.align-left {text-align:left;}
.align-right {text-align:right;}
.pre-14-24,.pre-14-24 p {font-size:14px; line-height:24px; margin:10px 0; color:#555; text-indent:30px;}
.hidden {display: none !important; visibility: hidden;}
.margin-10px {margin:10px 0;}
.inline-box {display:inline-block; vertical-align:middle;}

/*------ 【图标集合】 -------*/

.icon-s,.icon-m,.icon-l {color:#4b4b4b; text-align:center; display:inline-block; vertical-align:top; -moz-user-select:none; -webkit-user-select:none; font:Verdana, Geneva, sans-serif user-select:none;}
.active.icon-s,.active.icon-m {color:#00a2f0;}
a.icon-m:hover,.icon-m a:hover,a.icon-l:hover,.icon-l a:hover {text-decoration:none;}
.icon-canClick .icon-m:active,.icon-canClick .icon-l:active {box-shadow:inset 0 1px 3px rgba(0,0,0,.2);}
.icon-canClick .icon-s:active>*,.icon-canClick .icon-m:active>* {bottom:-1px; position:relative;}
/* 小号图标 12*12 */
.icon-s i,
.icon-s:before {width:20px; height:20px; margin:0 auto; content:''; text-indent:-9999px; background-image:url(../images/icon.png); display:block;}
.icon-s.view i {background-position:-4px -6px;}
.icon-s.error-square:before {background-position:-1px -60px;}
.icon-s.statistic:before {background-position:-1px -171px;}
.icon-s.download:before {background-position:-1px -200px;}

/* 中号图标 24*24 */
.icon-m i {display:block; width:24px; height:24px; text-indent:-9999px; background-image:url(../images/icon-m.png); background-repeat:no-repeat;}
.icon-m.dealFlow i {background-position:0 0;}
.icon-m.shops i {background-position:-52px 0;}
.icon-m.employees i {background-position:0 -26px;}
.icon-m.goods i {background-position:-52px -26px;}
.icon-m.sysAdmin i {background-position:0 -52px;}

/* 中号图标(hover与点亮状态) 24*24 */
.active .icon-m.dealFlow i {background-position:-26px 0;}
.active .icon-m.shops i {background-position:-78px 0;}
.active .icon-m.employees i {background-position:-26px -26px;}
.active .icon-m.goods i {background-position:-78px -26px;}
.active .icon-m.sysAdmin i {background-position:-26px -52px;}

.icon-xl i {display:block; height:130px; text-indent:-9999px; background-image:url(../images/icon-xl.png); background-repeat:no-repeat;}
.icon-xl.success i {}
.icon-xl.remind i {background-position:0 -132px;}
.icon-setting {width:18px; height:18px; background:url(../images/icon-setting.png) no-repeat; border:none;}
/*------ 【按钮集合】 -------*/
.btn {
    display: inline-block;
    padding: 5px 12px;
    margin-bottom: 0;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.428571429;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    background-image: none;
    border: 1px solid transparent;
    border-radius: 4px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -o-user-select: none;
    user-select: none;
}
.btn:focus {
    outline: thin dotted;
    outline: 5px auto -webkit-focus-ring-color;
    outline-offset: -2px;
}
.btn:hover,
.btn:focus {
    color: #333333;
    text-decoration: none;
}
.btn:active,
.btn.active {
    background-image: none;
    outline: 0;
    -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
}
.btn.disabled,
.btn[disabled],
fieldset[disabled] .btn {
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.65;
    filter: alpha(opacity=65);
    -webkit-box-shadow: none;
    box-shadow: none;
}
.btn-default {
    color: #333333;
    background-color: #ffffff;
    border-color: #cccccc;
}
.btn-default:hover,
.btn-default:focus,
.btn-default:active,
.btn-default.active,
.open .dropdown-toggle.btn-default {
    color: #333333;
    background-color: #ebebeb;
    border-color: #adadad;
}
.btn-default:active,
.btn-default.active,
.open .dropdown-toggle.btn-default {
    background-image: none;
}
.btn-default.disabled,
.btn-default[disabled],
fieldset[disabled] .btn-default,
.btn-default.disabled:hover,
.btn-default[disabled]:hover,
fieldset[disabled] .btn-default:hover,
.btn-default.disabled:focus,
.btn-default[disabled]:focus,
fieldset[disabled] .btn-default:focus,
.btn-default.disabled:active,
.btn-default[disabled]:active,
fieldset[disabled] .btn-default:active,
.btn-default.disabled.active,
.btn-default[disabled].active,
fieldset[disabled] .btn-default.active {
    background-color: #ffffff;
    border-color: #cccccc;
}

.btn-primary {
    color: #ffffff;
    background-color: #ff6d00;
    border-color: #dd6600;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.open .dropdown-toggle.btn-primary {
    color: #ffffff;
    background-color: #dd6600;
}

.btn-primary:active,
.btn-primary.active,
.open .dropdown-toggle.btn-primary {
    background-image: none;
}

.btn-primary.disabled,
.btn-primary[disabled],
fieldset[disabled] .btn-primary,
.btn-primary.disabled:hover,
.btn-primary[disabled]:hover,
fieldset[disabled] .btn-primary:hover,
.btn-primary.disabled:focus,
.btn-primary[disabled]:focus,
fieldset[disabled] .btn-primary:focus,
.btn-primary.disabled:active,
.btn-primary[disabled]:active,
fieldset[disabled] .btn-primary:active,
.btn-primary.disabled.active,
.btn-primary[disabled].active,
fieldset[disabled] .btn-primary.active {
    background-color: #ff6d00;
    border-color: #dd6600;
}

.btn-success {color:#fff; background-color:#5cb85c; border-color:#4cae4c;}
.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active, .open .dropdown-toggle.btn-success {
    color: #fff;
    background-color: #47a447;
    border-color: #398439;
}
.btn-success:active, .btn-success.active, .open .dropdown-toggle.btn-success {
    background-image: none;
}
.btn-danger {color:#fff; background-color: #e03233; border-color:#d61f20;}
.btn-danger:hover, .btn-danger:focus, .dtn-danger:active, .btn-danger.active {
    color:#fff;
    background-color:#d61f20;
}
.btn-w90 {width:90px; padding-left:0; padding-right:0;}
.caret {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 2px;
    vertical-align: middle;
    border-top: 4px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
}

/*选择*/
.radio, .checkbox {
    display: block;
    min-height: 20px;
    line-height:20px;
    padding-left: 18px;
    margin-top: 10px;
    margin-bottom: 10px;
    vertical-align: middle;
}
.radio label, .checkbox label {
    display: inline;
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
}
.radio input,.radio-inline input,.checkbox input,.checkbox-inline input {
    float: left;
    margin:3px 0 0 -18px;
}
.open .dropdown-menu {display:block;}
.dropdown-menu {
    position: absolute;
    display:none;
    z-index: 1000;
    float: left;
    min-width: 160px;
    margin: 2px 0 0;
    list-style: none;
    border: 5px solid rgba(0,0,0,0.25);
    border-radius: 4px;
}
.dropdown-menu>li {
    display: block;
    height:30px;
    line-height:30px;
    padding: 0 10px;
    background-color: #fff;
    clear: both;
    color: #333;
    text-align:left;
    white-space: nowrap;
    border-bottom:1px solid #ccc;
}
.dropdown-menu>li:hover {
    background:#d6f3ff; cursor:pointer;
}
.dropdown-menu>li.selected {
    background:#00a2e5;
    color:#fff;
}
.checklist li:before {
    display:inline-block;
    width:11px;
    height:11px;
    margin-right:6px;
    line-height:12px;
    text-indent:1px;
    content:"";
    border:1px solid #333;
}
.dropdown-menu.checklist>li.selected {background:#fff; color:#333;}
.dropdown-menu.checklist li.selected:before{content:"√"; font-family:"Tahoma";}
/*.dropdown-menu .li-danger {background:#e03233; color:#fff;}*/

.label {display:inline; padding:3px 10px; font:12px/16px "SimSun"; color:#fff; text-align:center; white-space:nowrap; vertical-align:baseline; border-radius:.3em;}
.label.has-hover:hover {cursor:pointer; box-shadow:inset 0 0 5px 10px rgba(0,0,0,.2);}
.label-default {background-color: #b7b7b7;}
.label-success {background-color: #5cb85c;}
.label-danger {background-color: #e03233;}


text:
<?xml version="1.0" encoding="UTF-8"?>
<billStatus>
  <bill>
    <cboCostEstimates />
    <notes />
    <originChamber>Senate</originChamber>
    <billNumber>1319</billNumber>
    <latestAction>
      <text>Read twice and referred to the Committee on Veterans' Affairs.</text>
      <links />
      <actionDate>2017-06-08</actionDate>
    </latestAction>
    <calendarNumbers />
    <updateDate>2017-09-28T04:36:49Z</updateDate>
    <policyArea>
      <name>Armed Forces and National Security</name>
    </policyArea>
    <introducedDate>2017-06-08</introducedDate>
    <titles>
      <item>
        <parentTitleType />
        <chamberCode />
        <titleType>(Extracted from GPO) Short Titles as Introduced</titleType>
        <title>Community Care Core Competency Act of 2017</title>
        <chamberName />
      </item>
      <item>
        <parentTitleType />
        <chamberCode />
        <titleType>Short Titles as Introduced</titleType>
        <title>Community Care Core Competency Act of 2017</title>
        <chamberName />
      </item>
      <item>
        <parentTitleType />
        <chamberCode />
        <titleType>Official Title as Introduced</titleType>
        <title>A bill to require the Secretary of Veterans Affairs to establish a continuing medical education program for non-Department of Veterans Affairs medical professionals who treat veterans to increase knowledge and recognition of medical conditions common to veterans, and for other purposes.</title>
        <chamberName />
      </item>
      <item>
        <parentTitleType />
        <chamberCode />
        <titleType>Display Title</titleType>
        <title>Community Care Core Competency Act of 2017</title>
        <chamberName />
      </item>
    </titles>
    <sponsors>
      <item>
        <state>OH</state>
        <firstName>SHERROD</firstName>
        <lastName>BROWN</lastName>
        <bioguideId>B000944</bioguideId>
        <fullName>Sen. Brown, Sherrod [D-OH]</fullName>
        <middleName />
        <party>D</party>
        <identifiers>
          <lisID>136</lisID>
          <gpoId>8309</gpoId>
          <bioguideId>B000944</bioguideId>
        </identifiers>
        <byRequestType />
      </item>
    </sponsors>
    <version>1.0.0</version>
    <committeeReports />
    <relatedBills />
    <createDate>2017-06-09T00:26:37Z</createDate>
    <cosponsors>
      <item>
        <bioguideId>D000563</bioguideId>
        <firstName>RICHARD</firstName>
        <middleName>J.</middleName>
        <fullName>Sen. Durbin, Richard J. [D-IL]</fullName>
        <identifiers>
          <bioguideId>D000563</bioguideId>
          <gpoId>8326</gpoId>
          <lisID>326</lisID>
        </identifiers>
        <lastName>DURBIN</lastName>
        <party>D</party>
        <sponsorshipWithdrawnDate />
        <state>IL</state>
        <isOriginalCosponsor>False</isOriginalCosponsor>
        <sponsorshipDate>2017-09-27</sponsorshipDate>
      </item>
    </cosponsors>
    <title>Community Care Core Competency Act of 2017</title>
    <laws />
    <subjects>
      <billSubjects>
        <policyArea>
          <name>Armed Forces and National Security</name>
        </policyArea>
        <legislativeSubjects />
      </billSubjects>
    </subjects>
    <congress>115</congress>
    <amendments />
    <billType>S</billType>
    <actions>
      <actionTypeCounts>
        <referredToCommittee>1</referredToCommittee>
        <introducedInSenate>1</introducedInSenate>
      </actionTypeCounts>
      <item>
        <actionDate>2017-06-08</actionDate>
        <committee>
          <systemCode>ssva00</systemCode>
          <name>Veterans' Affairs Committee</name>
        </committee>
        <links />
        <sourceSystem>
          0
          <name>Senate</name>
        </sourceSystem>
        <text>Read twice and referred to the Committee on Veterans' Affairs.</text>
        <type>IntroReferral</type>
      </item>
      <item>
        <type>IntroReferral</type>
        <actionCode>10000</actionCode>
        <actionDate>2017-06-08</actionDate>
        <sourceSystem>
          9
          <name>Library of Congress</name>
        </sourceSystem>
        <text>Introduced in Senate</text>
        <links />
        <committee />
      </item>
      <actionByCounts>
        <senate>2</senate>
      </actionByCounts>
    </actions>
    <recordedVotes />
    <committees>
      <billCommittees>
        <item>
          <activities>
            <item>
              <date>2017-06-08T17:25:18Z</date>
              <name>Referred to</name>
            </item>
          </activities>
          <name>Veterans' Affairs Committee</name>
          <chamber>Senate</chamber>
          <subcommittees />
          <type>Standing</type>
          <systemCode>ssva00</systemCode>
        </item>
      </billCommittees>
    </committees>
    <summaries>
      <billSummaries>
        <item>
          <updateDate>2017-06-08T04:00:00Z</updateDate>
          <versionCode>00</versionCode>
          <actionDesc>Introduced in Senate</actionDesc>
          <text><![CDATA[
Community Care Core Competency Act of 2017

This bill directs the Department of Veterans Affairs (VA) to establish a program to furnish continuing medical education material to non-VA medical professionals, with the goal of: (1) increasing knowledge and recognition of medical conditions common to veterans, and (2) improving outreach to veterans and family members.

The program must include education on: (1) dealing with patients who are veterans or family members; (2) identifying and treating common mental and physical conditions of veterans and family members; and (3) the VA health care system.

The VA shall: (1) carry out such program for five years on a VA website at no cost to participating non-VA medical professionals, and (2) ensure that the program is accredited in as many states as practicable.
]]></text>
          <name>Introduced in Senate</name>
          <actionDate>2017-06-08</actionDate>
          <lastSummaryUpdateDate>2017-07-25T21:22:48Z</lastSummaryUpdateDate>
        </item>
      </billSummaries>
    </summaries>
  </bill>
  <dublinCore xmlns:dc="http://purl.org/dc/elements/1.1/">
    <dc:format>text/xml</dc:format>
    <dc:language>EN</dc:language>
    <dc:rights>Pursuant to Title 17 Section 105 of the United States Code, this file is not subject to copyright protection and is in the public domain.</dc:rights>
    <dc:contributor>Congressional Research Service, Library of Congress</dc:contributor>
    <dc:description>This file contains bill summaries and statuses for federal legislation. A bill summary describes the most significant provisions of a piece of legislation and details the effects the legislative text may have on current law and federal programs. Bill summaries are authored by the Congressional Research Service (CRS) of the Library of Congress. As stated in Public Law 91-510 (2 USC 166 (d)(6)), one of the duties of CRS is "to prepare summaries and digests of bills and resolutions of a public general nature introduced in the Senate or House of Representatives". For more information, refer to the User Guide that accompanies this file.</dc:description>
  </dublinCore>
</billStatus>


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.PythonTools.Analysis;
using Microsoft.PythonTools.Parsing.Ast;
using Microsoft.VisualStudio.Text;
using Microsoft.VisualStudio.Text.Editor.OptionsExtensionMethods;
using Microsoft.Windows.Design.Host;

namespace Microsoft.PythonTools.Designer {
    class WpfEventBindingProvider : EventBindingProvider {
        private Project.PythonFileNode _pythonFileNode;

        public WpfEventBindingProvider(Project.PythonFileNode pythonFileNode) {
            _pythonFileNode = pythonFileNode;
        }

        public override bool AddEventHandler(EventDescription eventDescription, string objectName, string methodName) {
            // we return false here which causes the event handler to always be wired up via XAML instead of via code.
            return false;
        }

        public override bool AllowClassNameForMethodName() {
            return true;
        }

        public override void AppendStatements(EventDescription eventDescription, string methodName, string statements, int relativePosition) {
            throw new NotImplementedException();
        }

        public override string CodeProviderLanguage {
            get { return "Python"; }
        }

        public override bool CreateMethod(EventDescription eventDescription, string methodName, string initialStatements) {
            // build the new method handler
            var view = _pythonFileNode.GetTextView();
            var textBuffer = _pythonFileNode.GetTextBuffer();
            PythonAst ast;
            var classDef = GetClassForEvents(out ast);
            if (classDef != null) {
                int end = classDef.Body.EndIndex;

                // insert after the newline at the end of the last statement of the class def
                if (textBuffer.CurrentSnapshot[end] == '\r') {
                    if (end + 1 < textBuffer.CurrentSnapshot.Length &&
                        textBuffer.CurrentSnapshot[end + 1] == '\n') {
                        end += 2;
                    } else {
                        end++;
                    }
                } else if (textBuffer.CurrentSnapshot[end] == '\n') {
                    end++;
                }

                using (var edit = textBuffer.CreateEdit()) {
                    var text = BuildMethod(
                        eventDescription,
                        methodName,
                        new string(' ', classDef.Body.GetStart(ast).Column - 1),
                        view.Options.IsConvertTabsToSpacesEnabled() ?
                            view.Options.GetIndentSize() :
                            -1);

                    edit.Insert(end, text);
                    edit.Apply();
                    return true;
                }
            }

            return false;
        }

        private ClassDefinition GetClassForEvents() {
            PythonAst ast;
            return GetClassForEvents(out ast);
        }

        private ClassDefinition GetClassForEvents(out PythonAst ast) {
            ast = null;
            var analysis = _pythonFileNode.GetProjectEntry() as IPythonProjectEntry;

            if (analysis != null) {
                // TODO: Wait for up to date analysis
                ast = analysis.WaitForCurrentTree();
                var suiteStmt = ast.Body as SuiteStatement;
                foreach (var stmt in suiteStmt.Statements) {
                    var classDef = stmt as ClassDefinition;
                    // TODO: Make sure this is the right class
                    if (classDef != null) {
                        return classDef;
                    }
                }
            }
            return null;
        }

        private static string BuildMethod(EventDescription eventDescription, string methodName, string indentation, int tabSize) {
            StringBuilder text = new StringBuilder();
            text.AppendLine(indentation);
            text.Append(indentation);
            text.Append("def ");
            text.Append(methodName);
            text.Append('(');
            text.Append("self");
            foreach (var param in eventDescription.Parameters) {
                text.Append(", ");
                text.Append(param.Name);
            }
            text.AppendLine("):");
            if (tabSize < 0) {
                text.Append(indentation);
                text.Append("\tpass");
            } else {
                text.Append(indentation);
                text.Append(' ', tabSize);
                text.Append("pass");
            }
            text.AppendLine();

            return text.ToString();
        }

        public override string CreateUniqueMethodName(string objectName, EventDescription eventDescription) {
            var name = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}_{1}", objectName, eventDescription.Name);
            int count = 0;
            while (IsExistingMethodName(eventDescription, name)) {
                name = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}_{1}{2}", objectName, eventDescription.Name, ++count);
            }
            return name;
        }

        public override IEnumerable<string> GetCompatibleMethods(EventDescription eventDescription) {
            var classDef = GetClassForEvents();
            SuiteStatement suite = classDef.Body as SuiteStatement;

            if (suite != null) {
                int requiredParamCount = eventDescription.Parameters.Count() + 1;
                foreach (var methodCandidate in suite.Statements) {
                    FunctionDefinition funcDef = methodCandidate as FunctionDefinition;
                    if (funcDef != null) {
                        // Given that event handlers can be given any arbitrary
                        // name, it is important to not rely on the default naming
                        // to detect compatible methods.  Instead we look at the
                        // event parameters. We don't have param types in Python,
                        // so really the only thing that can be done is look at
                        // the method parameter count, which should be one more than
                        // the event parameter count (to account for the self param).
                        if (funcDef.Parameters.Count == requiredParamCount) {
                            yield return funcDef.Name;
                        }
                    }
                }
            }
        }

        public override IEnumerable<string> GetMethodHandlers(EventDescription eventDescription, string objectName) {
            return new string[0];
        }

        public override bool IsExistingMethodName(EventDescription eventDescription, string methodName) {
            return FindMethod(methodName) != null;
        }

        private FunctionDefinition FindMethod(string methodName) {
            var classDef = GetClassForEvents();
            SuiteStatement suite = classDef.Body as SuiteStatement;

            if (suite != null) {
                foreach (var methodCandidate in suite.Statements) {
                    FunctionDefinition funcDef = methodCandidate as FunctionDefinition;
                    if (funcDef != null) {
                        if (funcDef.Name == methodName) {
                            return funcDef;
                        }
                    }
                }
            }

            return null;
        }

        public override bool RemoveEventHandler(EventDescription eventDescription, string objectName, string methodName) {
            var method = FindMethod(methodName);
            if (method != null) {
                var view = _pythonFileNode.GetTextView();
                var textBuffer = _pythonFileNode.GetTextBuffer();

                // appending a method adds 2 extra newlines, we want to remove those if those are still
                // present so that adding a handler and then removing it leaves the buffer unchanged.

                using (var edit = textBuffer.CreateEdit()) {
                    int start = method.StartIndex - 1;

                    // eat the newline we insert before the method
                    while (start >= 0) {
                        var curChar = edit.Snapshot[start];
                        if (!Char.IsWhiteSpace(curChar)) {
                            break;
                        } else if (curChar == ' ' || curChar == '\t') {
                            start--;
                            continue;
                        } else if (curChar == '\n') {
                            if (start != 0) {
                                if (edit.Snapshot[start - 1] == '\r') {
                                    start--;
                                }
                            }
                            start--;
                            break;
                        } else if (curChar == '\r') {
                            start--;
                            break;
                        }

                        start--;
                    }

                    // eat the newline we insert at the end of the method
                    int end = method.EndIndex;
                    while (end < edit.Snapshot.Length) {
                        if (edit.Snapshot[end] == '\n') {
                            end++;
                            break;
                        } else if (edit.Snapshot[end] == '\r') {
                            if (end < edit.Snapshot.Length - 1 && edit.Snapshot[end + 1] == '\n') {
                                end += 2;
                            } else {
                                end++;
                            }
                            break;
                        } else if (edit.Snapshot[end] == ' ' || edit.Snapshot[end] == '\t') {
                            end++;
                            continue;
                        } else {
                            break;
                        }
                    }

                    // delete the method and the extra whitespace that we just calculated.
                    edit.Delete(Span.FromBounds(start + 1, end));
                    edit.Apply();
                }

                return true;
            }
            return false;
        }

        public override bool RemoveHandlesForName(string elementName) {
            throw new NotImplementedException();
        }

        public override bool RemoveMethod(EventDescription eventDescription, string methodName) {
            throw new NotImplementedException();
        }

        public override void SetClassName(string className) {
        }

        public override bool ShowMethod(EventDescription eventDescription, string methodName) {
            var method = FindMethod(methodName);
            if (method != null) {
                var view = _pythonFileNode.GetTextView();
                view.Caret.MoveTo(new VisualStudio.Text.SnapshotPoint(view.TextSnapshot, method.StartIndex));
                view.Caret.EnsureVisible();
                return true;
            }

            return false;
        }

        public override void ValidateMethodName(EventDescription eventDescription, string methodName) {
        }
    }
}


text:
require_relative 'value'
require_relative 'helpers'

module AdjustmentBureau
  class Parser

    def parse(property_string)
      name = parse_name(property_string)
      values = parse_values(property_string)
      return [name, values]
    end

  private

    def parse_name(property_string)
      property_string.split(':')[0].strip
    end

    def parse_values(property_string)
      values = property_string.split(':')[1].strip.gsub(/\;/, '')

      values.split(/\s+/m).collect do |value|
        Value.new(*parse_value(value))
      end
    end

    def parse_value(value)
      n = (value = value.to_s.strip)
      value = n.gsub(/[^0-9\.]/, '')
      unit =  /[^0-9\.]*$/.match(n)[0]

      return [
        Helpers.numerize(value),
        unit
      ]
    end
  end
end


text:
      Web service URL

    <input id="webServiceUrl" type="url" ng-model="model.value.url" class="umb-editor umb-textstring" />

      Form data will be sent to this URL as a POST request upon a successful form submission.

      User name

    <input id="webServiceUserName" type="text" ng-model="model.value.userName" class="umb-editor umb-textstring" />

      Password

    <input id="webServicePassword" type="text" ng-model="model.value.password" class="umb-editor umb-textstring" />

      The web service will be called using basic authentication. Leave the user name and password blank if you don't want to use authentication.


text:
  //SETUP

  //Add function shortcuts
  Form.setTemplates = Form.helpers.setTemplates;
  Form.setTemplateCompiler = Form.helpers.setTemplateCompiler;

  Form.templates = {};


text:
'use strict';

const lead = require('lead');
const pumpify = require('pumpify');
const toThrough = require('to-through');
const utils = require('./utils');

module.exports = options => {
  return function plugin(app) {
    if (app.src || (!app.collections && !app.isCollection)) return;

    /**
     * Setup middleware handlers. Assume none of the handlers exist if `onStream`
     * does not exist.
     */

    addHandlers(app, ['onLoad', 'onStream', 'preWrite', 'postWrite']);

    /**
     * Copy files with the given glob `patterns` to the specified `dest`.
     *
     * ```js
     * app.task('assets', function(cb) {
     *   app.copy('assets/**', 'dist/')
     *     .on('error', cb)
     *     .on('finish', cb)
     * });
     * ```
     * @name .copy
     * @param {String|Array} `patterns` Glob patterns of files to copy.
     * @param  {String|Function} `dest` Desination directory.
     * @return {Stream} Stream, to continue processing if necessary.
     * @api public
     */

    utils.define(app, 'copy', (patterns, dest, options) => {
      return utils.vfs.src(patterns, { allowEmpty: true, ...options })
        .pipe(utils.vfs.dest(dest, options));
    });

    /**
     * Glob patterns or filepaths to source files.
     *
     * ```js
     * app.src('src/*.hbs', {layout: 'default'});
     * ```
     * @name .src
     * @param {String|Array} `glob` Glob patterns or file paths to source files.
     * @param {Object} `options` Options or locals to merge into the context and/or pass to `src` plugins
     * @api public
     */

    utils.define(app, 'src', (patterns, options) => {
      let streams = pumpify.obj([
        utils.src(patterns, { allowEmpty: true, ...options }),
        handle(app, 'onStream'),
        toFiles(app, options)
      ]);
      return toThrough(streams);
    });

    /**
     * Glob patterns or paths for symlinks.
     *
     * ```js
     * app.symlink('src/**');
     * ```
     * @name .symlink
     * @param {String|Array} `glob`
     * @api public
     */

    utils.define(app, 'symlink', (...args) => utils.vfs.symlink(...args));

    /**
     * Specify a destination for processed files. Runs `.preWrite` and
     * `.postWrite` middleware handlers on all files.
     *
     * ```js
     * app.dest('dist/');
     * ```
     * @name .dest
     * @param {String|Function} `dest` File path or rename function.
     * @param {Object} `options` Options and locals to pass to `dest` plugins
     * @api public
     */

    utils.define(app, 'dest', (dest, options = {}) => {
      if (!dest) {
        throw new TypeError('expected dest to be a string or function');
      }

      // ensure "dest" is added to the context before rendering
      utils.prepareDest(app, dest, options);

      let output = pumpify.obj([
        handle(app, 'preWrite'),
        utils.dest(dest, options),
        handle(app, 'postWrite')
      ]);

      return lead(output);
    });

    return plugin;
  };
};

function addHandlers(app, handlers) {
  for (let name of handlers) {
    if (typeof app[name] !== 'function') {
      app.handler(name);
    }
  }
}

/**
 * Make sure vinyl files are assemble files, and add
 * them to a collection, if specified.
 */

function toFiles(app, options) {
  let opts = Object.assign({ collection: null }, options);
  let name = opts.collection;
  let collection = app.collections ? name && app[name] : app;
  let view;

  if (!collection && name) {
    collection = app.create(name, opts);
  }

  return utils.through.obj(async (file, enc, next) => {
    if (!app.File.isFile(file)) {
      file = app.file(file.path, file);
    }

    if (file.isNull()) {
      next(null, file);
      return;
    }

    if (collection && isCollection(collection)) {
      try {
        view = await collection.set(file.path, file);
      } catch (err) {
        next(err);
        return;
      }
      next(null, view);
      return;
    }

    view = !app.File.isFile(file) ? app.file(file.path, file) : file;

    app.handle('onLoad', view)
      .then(() => next(null, view))
      .catch(next);
  });
}

function isCollection(collection) {
  return collection.files && !collection.collections;
}

function handle(app, method) {
  return utils.through.obj(async (file, enc, next) => {
    if (!file || (!file.path && !file.isNull && !file.contents)) {
      next(null, file);
      return;
    }

    if (file.isNull() || !app.handle) {
      next(null, file);
      return;
    }

    if (typeof app[method] !== 'function') {
      next(new Error(`middleware handler "${method}" is not registered`));
      return;
    }

    app.handle(method, file)
      .then(() => next(null, file))
      .catch(next);
  });
}


text:
class PlanningDurationToWork < ActiveRecord::Migration
  def self.up
  	rename_column :tasks, :duration_in_day, :work_in_day
  end

  def self.down
  	rename_column :tasks, :work_in_day, :duration_in_day
  end
end


text:
"""scanalyzer.flag - storing and editing flag information for UV data

We consider a limited form of flags: they are regions in the
frequency/time/basepol space.

"""
from __future__ import absolute_import, division, print_function, unicode_literals

__all__ = b'FlagAPI FlagImplementation FlagTransform'.split ()

class FlagAPI (object):
    def add (self, tst, tend, fst, fend, bpmatch):
        """Create or modify a record. Returns its ident.

        If a record with the specified time/freq bounds already exists,
        it is modified and its ident is returned. Otherwise, a new record
        is added.

        *bpmatch* is either None, indicating that the record applies to
        all basepols, or a set of antpol 2-tuples.
        """
        raise NotImplementedError ()

    def get (self, ident):
        """Return (tst, tend, fst, fend, bpmatch)."""
        raise NotImplementedError ()

    def setBPMatch (self, ident, bpmatch):
        """Change the basepol matching component of a record."""
        raise NotImplementedError ()

    def resize (self, ident, tst, tend, fst, fend):
        """Change the freq/time shape of an existing region."""
        raise NotImplementedError ()

    def delete (self, ident):
        """Delete the record."""
        raise NotImplementedError ()

    def toggleBasepol (self, ident, bp):
        """Modify the bpmatch of the specified record by toggling
        whether the specified record applies to the specified
        antpols. A noop if the record has a broader basepol selection
        that causes it to apply to *bp* anyway."""
        raise NotImplementedError ()

    def applyToRegion (self, bp, taxis, faxis, flags):
        """*bp* is a basepol
        *flags* is array of bools of shape (ntimes, nfreqs)
        """
        raise NotImplementedError ()

    def getRecords (self, taxis, faxis):
        """Get list of flag records applying to the given region
        Returns iterable of (ident, tst, tend, fst, fend).
        """
        raise NotImplementedError ()

    def checkBasepol (self, bp):
        """Return whether the specified basepol is flagged given the
        current set of records."""
        raise NotImplementedError ()

TST, TEND, FST, FEND, BPMATCH = range (5)
DELETED = set () # right semantics for deleted records

def bpmatches (bpmatch, bp):
    if bpmatch is None:
        return True
    return bp in bpmatch

def normalrecord (rec):
    bpmatch = rec[BPMATCH]

    if bpmatch is DELETED:
        return False
    if bpmatch is not None and len (bpmatch) == 0:
        return False
    return True

def cmprecord (left, right):
    # The Python implementation of __cmp__ for tuples is good enough
    # for comparing the frequency/time components. We just need to be
    # crafty about the sets.

    lft = tuple (left[:4])
    rft = tuple (right[:4])

    result = cmp (lft, rft)
    if result:
        return result

    lbpmatch = left[BPMATCH]
    rbpmatch = right[BPMATCH]

    if lbpmatch is None:
        if rbpmatch is None:
            return 0
        return -1
    elif rbpmatch is None:
        return 1

    lbplen = len (lbpmatch)
    rbplen = len (rbpmatch)

    result = cmp (lbplen, rbplen)
    if result:
        return result

    return cmp (tuple (sorted (lbpmatch)), tuple (sorted (rbpmatch)))

class FlagImplementation (FlagAPI):
    def __init__ (self, path):
        self.records = []
        self.path = path

        if path is None:
            from pwkit.cli import warn
            warn ('flags will not be saved to disk')

    def add (self, tst, tend, fst, fend, bpmatch):
        if (tst is None) ^ (tend is None):
            raise ValueError ('both or neither of tst and tend must be None')
        if (fst is None) ^ (fend is None):
            raise ValueError ('both or neither of fst and fend must be None')
        if not (bpmatch is None or isinstance (bpmatch, set)):
            raise ValueError ('bpmatch must be a set or None')

        cbounds = (tst, tend, fst, fend)

        for ident, (itst, itend, ifst, ifend, ibpmatch) in enumerate (self.records):
            if ibpmatch is DELETED:
                continue
            if (itst, itend, ifst, ifend) == cbounds:
                if bpmatch is None:
                    self.records[ident][BPMATCH] = None
                elif ibpmatch is None:
                    pass # noop, already an all-matcher
                else:
                    ibpmatch.update (bpmatch)
                return ident

        # Need to create new record.
        self.records.append ([tst, tend, fst, fend, bpmatch])
        return len (self.records) - 1

    def get (self, ident):
        if self.records[ident][BPMATCH] is DELETED:
            raise ValueError ('querying deleted record')
        return self.records[ident]

    def setBPMatch (self, ident, bpmatch):
        if self.records[ident][BPMATCH] is DELETED:
            raise ValueError ('modifying deleted record')
        if not (bpmatch is None or isinstance (bpmatch, set)):
            raise ValueError ('bpmatch must be a set or None')

        self.records[ident][BPMATCH] = bpmatch

    def resize (self, ident, tst, tend, fst, fend):
        if self.records[ident][BPMATCH] is DELETED:
            raise ValueError ('modifying deleted record')
        if (tst is None) ^ (tend is None):
            raise ValueError ('both or neither of tst and tend must be None')
        if (fst is None) ^ (fend is None):
            raise ValueError ('both or neither of fst and fend must be None')

        self.records[ident][TST:BPMATCH] = tst, tend, fst, fend

    def delete (self, ident):
        if self.records[ident][BPMATCH] is DELETED:
            raise ValueError ('modifying deleted record')
        self.records[ident][BPMATCH] = DELETED

    def toggleBasepol (self, ident, bp):
        """Returns whether the record was actually modified."""

        bpm = self.records[ident][BPMATCH]

        if bpm is DELETED:
            raise ValueError ('modifying deleted record')

        if bpm is None:
            # noop, matches all antpols
            return False

        if bp in bpm:
            bpm.remove (bp)
        else:
            bpm.add (bp)

        return True

    def applyToRegion (self, bp, taxis, faxis, flags):
        assert taxis.size == flags.shape[0]
        assert faxis.size == flags.shape[1]

        for tst, tend, fst, fend, bpmatch in self.records:
            if not bpmatches (bpmatch, bp):
                continue

            if tst is None and fst is None:
                # Unbounded in frequency and time. Total flaggitude.
                flags.fill (0)
            elif tst is None:
                # Unbounded in time.
                sl = faxis.overlapSlice (fst, fend)
                if sl is None:
                    continue

                flags[:,sl] = 0
            elif fst is None:
                # Unbounded in frequency.
                sl = taxis.overlapSlice (tst, tend)
                if sl is None:
                    continue

                flags[sl,:] = 0
            else:
                # Bounded in both.
                tsl = taxis.overlapSlice (tst, tend)
                if tsl is None:
                    continue

                fsl = faxis.overlapSlice (fst, fend)
                if fsl is None:
                    continue

                flags[tsl,fsl] = 0

    def getRecords (self, taxis, faxis):
        for ident, (tst, tend, fst, fend, bpmatch) in enumerate (self.records):
            if bpmatch is DELETED:
                continue
            if tst is not None and not taxis.overlaps (tst, tend):
                continue
            if fst is not None and not faxis.overlaps (fst, fend):
                continue

            yield ident, tst, tend, fst, fend

    def checkBasepol (self, bp):
        for tst, tend, fst, fend, bpmatch in self.records:
            if bpmatch is DELETED:
                continue
            if tst is not None or fst is not None:
                # only looking for all-freq/all-time flags
                continue
            if bpmatches (bpmatch, bp):
                return True

        return False

    def _save (self, stream):
        # We can currently write out our data in ARF multiflag
        # format and still save/restore all of the information we need.
        from .ui import jdToFull
        from .mtutil import fmtBP

        s = sorted ((rec for rec in self.records if normalrecord (rec)),
                     cmp=cmprecord)

        for tst, tend, fst, fend, bpmatch in s:
            record = []

            if tst is not None:
                record.append ('time(%s,%s)' % (jdToFull (tst), jdToFull (tend)))
            if fst is not None:
                record.append ('freq(%.18e,%.18e)' % (fst, fend))
            if bpmatch is not None:
                record.append ('basepol(%s)' % ','.join (fmtBP (x) for x in sorted (bpmatch)))

            print (' '.join (record), file=stream)

    def _load(self, stream):
        from .mtutil import parseBP

        for line in stream:
            bits = line.split('#', 1)[0].strip().split()
            if not len(bits):
                continue

            tst = tend = fst = fend = None
            bpmatch = None

            for bit in bits:
                if bit.startswith('freq(') and bit.endswith(')'):
                    subbits = bit[5:-1].split(',')
                    if len(subbits) != 2:
                        raise Exception('unhandled line in flags file (A): %r' % (line,))
                    fst, fend = map(float, subbits)
                elif bit.startswith('time(') and bit.endswith(')'):
                    # XXX: hardcoding our fake jdToFull that uses floats
                    subbits = bit[5:-1].split(',')
                    if len(subbits) != 2:
                        raise Exception('unhandled line in flags file (B): %r' % (line,))
                    tst, tend = map(float, subbits)
                elif bit.startswith('basepol(') and bit.endswith(')'):
                    bpmatch = set()
                    for bptext in bit[8:-1].split(','):
                        bpmatch.add(parseBP(bptext))
                    if not len(bpmatch):
                        # empty-set bpmatch signifies DELETED
                        raise Exception('unhandled line in flags file (C): %r' % (line,))
                else:
                    raise Exception('unhandled line in flags file (D): %r' % (line,))

            self.records.append([tst, tend, fst, fend, bpmatch])

    def try_load (self):
        if self.path is None:
            return # nothing to do here

        from pwkit.io import try_open

        f = try_open (self.path)
        if f is not None:
            self._load (f)
            f.close ()

    def save (self):
        if self.path is None:
            return # nothing to do here

        from os import rename
        self._save (open (self.path + '.new', 'w'))
        try:
            rename (self.path, self.path + '~')
        except OSError as e:
            if e.errno != 2:
                raise
        rename (self.path + '.new', self.path)

from .tdata import DataTransform

class FlagTransform (DataTransform):
    def __init__ (self, flagapi):
        self.flagapi = flagapi

    def getGrid (self, bp):
        vgrid = self.parent.getGrid (bp).shallowcopy ()
        vgrid.flags = vgrid.flags.copy ()
        self.flagapi.applyToRegion (bp, vgrid.taxis,
                                    vgrid.faxis, vgrid.flags)
        return vgrid

    _myfeatures = frozenset (('checkallflagged', ))

    def knownAllFlagged (self, bp):
        if self.parent.hasFeature ('checkallflagged'):
            if self.parent.knownAllFlagged (bp):
                return True

        return self.flagapi.checkBasepol (bp)


text:
This program tries to read Google Cardboard's current_device_params file, and
display the parameters to the user. Ideally, it would also allow the user to adjust
the interlens distance, as this is also a sort of proxy for interpupillary distance,
which varies widely between users.

It's based off of Cardboard Profile Dumper:
https://github.com/TheOnlyJoey/CardboardProfileDumper

and the CardboardDevice.proto file from
https://github.com/google/wwgc/blob/master/www/CardboardDevice.proto

Current problems:
--Has to skip the first 7 bytes of the file in order to read correctly.  Since
  I don't know what these bytes signify, this prevents editing/writing the file.
--Doesn't seem to show the has_magnet or primary_button fields from the
  protocol buffer. Oddly, when I viewed a sample file in a hex editor, I didn't
  see these values either; according to their types and position numbers, and
  the encoding scheme described at
  https://developers.google.com/protocol-buffers/docs/encoding#types
  I think they should be prefixed by 50 and 60, respectively, but I don't see
  those values in the file. I really need to print out the file and annotate
  it, though.


text:
<?xml version="1.0" encoding="UTF-8"?>

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

	<!-- Seam -->

	<listener>
		<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
	</listener>

	<filter>
		<filter-name>Seam Filter</filter-name>
		<filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
	</filter>

	<filter-mapping>
		<filter-name>Seam Filter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<!-- JSF -->

	<context-param>
		<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
		<param-value>.xhtml</param-value>
	</context-param>

	<servlet>
		<servlet-name>Faces Servlet</servlet-name>
		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet-mapping>
		<servlet-name>Faces Servlet</servlet-name>
		<url-pattern>*.jsf</url-pattern>
	</servlet-mapping>

	<session-config>
		<session-timeout>10</session-timeout>
	</session-config>

</web-app>


text:
// Copyright (c) Dyoub Applications. All rights reserved.
// Licensed under MIT (https://github.com/dyoub/app/blob/master/LICENSE).

(function () {

    function Service() { }

    Service.prototype.create = function (max) {
        var installments = [];

        for (var installment = 1; installment <= max; installment++) {
            installments.push(installment);
        }

        return installments;
    };

    angular.module('dyoub.app').service('Installment', [
        Service
    ]);

})();


text:
Just another 4-digit NACA airfoil MATLAB solver

## Basic usage
```matlab
dvm % the script will ask for your input
```

## If you are feeling pro, however, or want to iterate over the script
```matlab
[Cl,Cm] = dvm('4412',5,500,'c','y',8,15)
% The arguments are, in order of appearance:
% - 4-digit NACA (string)
% - Angle of attack (º)
% - Number of panels (integer)
% - Type of geometry discretization ('a'. Uniform, 'b'. Full cosine, 'c'. Experimental)
% - Include a flap? ('y'/'n')
% (-) Flap hinge position (in tenths of chord)
% (-) Flap deflection angle (º)
```


text:
```js

import { BaseModel } from 'mobx-model';

class Post extends BaseModel {

	static attributes = {
		title: ''
	}

	static relations = [
		{
			type: 'hasMany',
			relatedModel: 'Comment'
		}
	]

}

```

## model.set

Set method is used to update model instance's attributes, its relations and attributes of relations recursively. If relation had a `reverseRelation` property defined or set to `true` then this model instance will be made available at `reverseRelation.propertyName`

```js
let json = {
	comments: [
		{
			id: 1,
			content: 'nice post!'
		}
	],
	post: {
		id: 1,
		title: 'new title',
		comment_ids: [1]
	}
}

let post = Post.get(1);
post.set({ modelJson: json.post, topLevelJson: json });
```

#### Options

| option | type | description |
| -- | -- | -- |
| `modelJson` | `object` | Json with model's attributes. It can contain either ids of relations deisgnated by the relation `foreignKey` property, or embedded json for relations designated by `jsonKey` property in relation config  |
| `topLevelJson` | `object` | When looking up relations referenced by ids `topLevelJsonKey` relation config property is used to find object in `topLevelJson` that contains related objects |

## model.urlRoot, model.jsonKey

Just couple of shorthand methods that returns prefix for model's RESTful methods and model's key to find its attributes in JSON. Both methods are usually used in server actions

```js
class Post extends BaseModel {

	update(attributes = {}) {
	  return API.request({
	    method: 'put',
	    data: attributes,
	    endpoint: `${this.urlRoot}/${this.id}`,
	    onSuccess: (response) => {
	    	let json = response.body;
	      this.set({ modelJson: json[this.jsonKey] });
	    }
	  });
	}

}

```

### model.onInitialize

This is a hook called when model instance is initialized.
Redefine it in your models to add functionality to each model instance, such as custom observable attribute

```
class Model extends BaseModel {
	onInitialize() {
		this.observableMeta = observable({
			action: null,
			someStuff: null
		})
	}
}
```

### model.onDestroy

This is a shorthand method that calls all methods listed below — `removeSelfFromCollection`, `destroyDependentRelations`, `removeSelfFromRelations`. It does all cleanup that is neccessary when model is being destroyed.

### model.removeSelfFromCollection

Removes this model instance from collection of cached models of this class

### model.destroyDependentRelations

Finds relations that have `onDestroy: 'destroyRelation'` config option and calls `onDestroy` method on those relations, removing them from model cache.

### model.removeSelfFromRelations

Finds relations that have `onDestroy: 'removeSelf'` config option set (which is default) and removes this model instance from those relation model instances