text:
"""
This namespace contains endpoints user management.
"""

try:
    from . import babel_validators as bv
except (SystemError, ValueError):
    # Catch errors raised when importing a relative module when not in a package.
    # This makes testing this file directly (outside of a package) easier.
    import babel_validators as bv

class GetAccountArg(object):
    """
    Arguments for get_account.

    :ivar account_id: A user's account identifier.
    """

    __slots__ = [
        '_account_id_value',
        '_account_id_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 account_id=None):
        self._account_id_value = None
        self._account_id_present = False
        if account_id is not None:
            self.account_id = account_id

    @property
    def account_id(self):
        """
        A user's account identifier.

        :rtype: str
        """
        if self._account_id_present:
            return self._account_id_value
        else:
            raise AttributeError("missing required field 'account_id'")

    @account_id.setter
    def account_id(self, val):
        val = self._account_id_validator.validate(val)
        self._account_id_value = val
        self._account_id_present = True

    @account_id.deleter
    def account_id(self):
        self._account_id_value = None
        self._account_id_present = False

    def __repr__(self):
        return 'GetAccountArg(account_id={!r})'.format(
            self._account_id_value,
        )

class GetAccountError(object):
    """
    Error returned by get_account.

    :ivar no_account: The specified ``GetAccountArg.account_id`` does not exist.
    """

    __slots__ = ['_tag', '_value']

    _catch_all = 'unknown'
    # Attribute is overwritten below the class definition
    no_account = None
    # Attribute is overwritten below the class definition
    unknown = None

    def __init__(self, tag, value=None):
        assert tag in self._tagmap, 'Invalid tag %r.' % tag
        validator = self._tagmap[tag]
        if isinstance(validator, bv.Void):
            assert value is None, 'Void type union member must have None value.'
        elif isinstance(validator, (bv.Struct, bv.Union)):
            validator.validate_type_only(value)
        else:
            validator.validate(value)
        self._tag = tag
        self._value = value

    def is_no_account(self):
        return self._tag == 'no_account'

    def is_unknown(self):
        return self._tag == 'unknown'

    def __repr__(self):
        return 'GetAccountError(%r)' % self._tag

class AccountType(object):
    """
    What type of account this user has.

    :ivar basic: The basic account type.
    :ivar pro: The Dropbox Pro account type.
    :ivar business: The Dropbox for Business account type.
    """

    __slots__ = ['_tag', '_value']

    _catch_all = None
    # Attribute is overwritten below the class definition
    basic = None
    # Attribute is overwritten below the class definition
    pro = None
    # Attribute is overwritten below the class definition
    business = None

    def __init__(self, tag, value=None):
        assert tag in self._tagmap, 'Invalid tag %r.' % tag
        validator = self._tagmap[tag]
        if isinstance(validator, bv.Void):
            assert value is None, 'Void type union member must have None value.'
        elif isinstance(validator, (bv.Struct, bv.Union)):
            validator.validate_type_only(value)
        else:
            validator.validate(value)
        self._tag = tag
        self._value = value

    def is_basic(self):
        return self._tag == 'basic'

    def is_pro(self):
        return self._tag == 'pro'

    def is_business(self):
        return self._tag == 'business'

    def __repr__(self):
        return 'AccountType(%r)' % self._tag

class Account(object):
    """
    The amount of detail revealed about an account depends on the user being
    queried and the user making the query.

    :ivar account_id: The user's unique Dropbox ID.
    :ivar name: Details of a user's name.
    """

    __slots__ = [
        '_account_id_value',
        '_account_id_present',
        '_name_value',
        '_name_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 account_id=None,
                 name=None):
        self._account_id_value = None
        self._account_id_present = False
        self._name_value = None
        self._name_present = False
        if account_id is not None:
            self.account_id = account_id
        if name is not None:
            self.name = name

    @property
    def account_id(self):
        """
        The user's unique Dropbox ID.

        :rtype: str
        """
        if self._account_id_present:
            return self._account_id_value
        else:
            raise AttributeError("missing required field 'account_id'")

    @account_id.setter
    def account_id(self, val):
        val = self._account_id_validator.validate(val)
        self._account_id_value = val
        self._account_id_present = True

    @account_id.deleter
    def account_id(self):
        self._account_id_value = None
        self._account_id_present = False

    @property
    def name(self):
        """
        Details of a user's name.

        :rtype: Name
        """
        if self._name_present:
            return self._name_value
        else:
            raise AttributeError("missing required field 'name'")

    @name.setter
    def name(self, val):
        self._name_validator.validate_type_only(val)
        self._name_value = val
        self._name_present = True

    @name.deleter
    def name(self):
        self._name_value = None
        self._name_present = False

    def __repr__(self):
        return 'Account(account_id={!r}, name={!r})'.format(
            self._account_id_value,
            self._name_value,
        )

class BasicAccount(Account):
    """
    Basic information about any account.

    :ivar is_teammate: Whether this user is a teammate of the current user. If
        this account is the current user's account, then this will be ``True``.
    """

    __slots__ = [
        '_is_teammate_value',
        '_is_teammate_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 account_id=None,
                 name=None,
                 is_teammate=None):
        super(BasicAccount, self).__init__(account_id,
                                           name)
        self._is_teammate_value = None
        self._is_teammate_present = False
        if is_teammate is not None:
            self.is_teammate = is_teammate

    @property
    def is_teammate(self):
        """
        Whether this user is a teammate of the current user. If this account is
        the current user's account, then this will be ``True``.

        :rtype: bool
        """
        if self._is_teammate_present:
            return self._is_teammate_value
        else:
            raise AttributeError("missing required field 'is_teammate'")

    @is_teammate.setter
    def is_teammate(self, val):
        val = self._is_teammate_validator.validate(val)
        self._is_teammate_value = val
        self._is_teammate_present = True

    @is_teammate.deleter
    def is_teammate(self):
        self._is_teammate_value = None
        self._is_teammate_present = False

    def __repr__(self):
        return 'BasicAccount(account_id={!r}, name={!r}, is_teammate={!r})'.format(
            self._account_id_value,
            self._name_value,
            self._is_teammate_value,
        )

class FullAccount(Account):
    """
    Detailed information about the current user's account.

    :ivar email: The user's e-mail address.
    :ivar country: The user's two-letter country code, if available. Country
        codes are based on `ISO 3166-1
        <http://en.wikipedia.org/wiki/ISO_3166-1>`_.
    :ivar locale: The language that the user specified. Locale tags will be
        `IETF language tags <http://en.wikipedia.org/wiki/IETF_language_tag>`_.
    :ivar referral_link: The user's `referral link
        <https://www.dropbox.com/referrals>`_.
    :ivar team: If this account is a member of a team, information about that
        team.
    :ivar is_paired: Whether the user has a personal and work account. If the
        current account is personal, then ``team`` will always be None, but
        ``is_paired`` will indicate if a work account is linked.
    :ivar account_type: What type of account this user has.
    """

    __slots__ = [
        '_email_value',
        '_email_present',
        '_country_value',
        '_country_present',
        '_locale_value',
        '_locale_present',
        '_referral_link_value',
        '_referral_link_present',
        '_team_value',
        '_team_present',
        '_is_paired_value',
        '_is_paired_present',
        '_account_type_value',
        '_account_type_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 account_id=None,
                 name=None,
                 email=None,
                 locale=None,
                 referral_link=None,
                 is_paired=None,
                 account_type=None,
                 country=None,
                 team=None):
        super(FullAccount, self).__init__(account_id,
                                          name)
        self._email_value = None
        self._email_present = False
        self._country_value = None
        self._country_present = False
        self._locale_value = None
        self._locale_present = False
        self._referral_link_value = None
        self._referral_link_present = False
        self._team_value = None
        self._team_present = False
        self._is_paired_value = None
        self._is_paired_present = False
        self._account_type_value = None
        self._account_type_present = False
        if email is not None:
            self.email = email
        if country is not None:
            self.country = country
        if locale is not None:
            self.locale = locale
        if referral_link is not None:
            self.referral_link = referral_link
        if team is not None:
            self.team = team
        if is_paired is not None:
            self.is_paired = is_paired
        if account_type is not None:
            self.account_type = account_type

    @property
    def email(self):
        """
        The user's e-mail address.

        :rtype: str
        """
        if self._email_present:
            return self._email_value
        else:
            raise AttributeError("missing required field 'email'")

    @email.setter
    def email(self, val):
        val = self._email_validator.validate(val)
        self._email_value = val
        self._email_present = True

    @email.deleter
    def email(self):
        self._email_value = None
        self._email_present = False

    @property
    def country(self):
        """
        The user's two-letter country code, if available. Country codes are
        based on `ISO 3166-1 <http://en.wikipedia.org/wiki/ISO_3166-1>`_.

        :rtype: str
        """
        if self._country_present:
            return self._country_value
        else:
            return None

    @country.setter
    def country(self, val):
        if val is None:
            del self.country
            return
        val = self._country_validator.validate(val)
        self._country_value = val
        self._country_present = True

    @country.deleter
    def country(self):
        self._country_value = None
        self._country_present = False

    @property
    def locale(self):
        """
        The language that the user specified. Locale tags will be `IETF language
        tags <http://en.wikipedia.org/wiki/IETF_language_tag>`_.

        :rtype: str
        """
        if self._locale_present:
            return self._locale_value
        else:
            raise AttributeError("missing required field 'locale'")

    @locale.setter
    def locale(self, val):
        val = self._locale_validator.validate(val)
        self._locale_value = val
        self._locale_present = True

    @locale.deleter
    def locale(self):
        self._locale_value = None
        self._locale_present = False

    @property
    def referral_link(self):
        """
        The user's `referral link <https://www.dropbox.com/referrals>`_.

        :rtype: str
        """
        if self._referral_link_present:
            return self._referral_link_value
        else:
            raise AttributeError("missing required field 'referral_link'")

    @referral_link.setter
    def referral_link(self, val):
        val = self._referral_link_validator.validate(val)
        self._referral_link_value = val
        self._referral_link_present = True

    @referral_link.deleter
    def referral_link(self):
        self._referral_link_value = None
        self._referral_link_present = False

    @property
    def team(self):
        """
        If this account is a member of a team, information about that team.

        :rtype: Team
        """
        if self._team_present:
            return self._team_value
        else:
            return None

    @team.setter
    def team(self, val):
        if val is None:
            del self.team
            return
        self._team_validator.validate_type_only(val)
        self._team_value = val
        self._team_present = True

    @team.deleter
    def team(self):
        self._team_value = None
        self._team_present = False

    @property
    def is_paired(self):
        """
        Whether the user has a personal and work account. If the current account
        is personal, then ``team`` will always be None, but ``is_paired`` will
        indicate if a work account is linked.

        :rtype: bool
        """
        if self._is_paired_present:
            return self._is_paired_value
        else:
            raise AttributeError("missing required field 'is_paired'")

    @is_paired.setter
    def is_paired(self, val):
        val = self._is_paired_validator.validate(val)
        self._is_paired_value = val
        self._is_paired_present = True

    @is_paired.deleter
    def is_paired(self):
        self._is_paired_value = None
        self._is_paired_present = False

    @property
    def account_type(self):
        """
        What type of account this user has.

        :rtype: AccountType
        """
        if self._account_type_present:
            return self._account_type_value
        else:
            raise AttributeError("missing required field 'account_type'")

    @account_type.setter
    def account_type(self, val):
        self._account_type_validator.validate_type_only(val)
        self._account_type_value = val
        self._account_type_present = True

    @account_type.deleter
    def account_type(self):
        self._account_type_value = None
        self._account_type_present = False

    def __repr__(self):
        return 'FullAccount(account_id={!r}, name={!r}, email={!r}, locale={!r}, referral_link={!r}, is_paired={!r}, account_type={!r}, country={!r}, team={!r})'.format(
            self._account_id_value,
            self._name_value,
            self._email_value,
            self._locale_value,
            self._referral_link_value,
            self._is_paired_value,
            self._account_type_value,
            self._country_value,
            self._team_value,
        )

class Team(object):
    """
    Information about a team.

    :ivar id: The team's unique ID.
    :ivar name: The name of the team.
    """

    __slots__ = [
        '_id_value',
        '_id_present',
        '_name_value',
        '_name_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 id=None,
                 name=None):
        self._id_value = None
        self._id_present = False
        self._name_value = None
        self._name_present = False
        if id is not None:
            self.id = id
        if name is not None:
            self.name = name

    @property
    def id(self):
        """
        The team's unique ID.

        :rtype: str
        """
        if self._id_present:
            return self._id_value
        else:
            raise AttributeError("missing required field 'id'")

    @id.setter
    def id(self, val):
        val = self._id_validator.validate(val)
        self._id_value = val
        self._id_present = True

    @id.deleter
    def id(self):
        self._id_value = None
        self._id_present = False

    @property
    def name(self):
        """
        The name of the team.

        :rtype: str
        """
        if self._name_present:
            return self._name_value
        else:
            raise AttributeError("missing required field 'name'")

    @name.setter
    def name(self, val):
        val = self._name_validator.validate(val)
        self._name_value = val
        self._name_present = True

    @name.deleter
    def name(self):
        self._name_value = None
        self._name_present = False

    def __repr__(self):
        return 'Team(id={!r}, name={!r})'.format(
            self._id_value,
            self._name_value,
        )

class Name(object):
    """
    Representations for a person's name to assist with internationalization.

    :ivar given_name: Also known as a first name.
    :ivar surname: Also known as a last name or family name.
    :ivar familiar_name: Locale-dependent name. In the US, a person's familiar
        name is their ``given_name``, but elsewhere, it could be any combination
        of a person's ``given_name`` and ``surname``.
    :ivar display_name: A name that can be used directly to represent the name
        of a user's Dropbox account.
    """

    __slots__ = [
        '_given_name_value',
        '_given_name_present',
        '_surname_value',
        '_surname_present',
        '_familiar_name_value',
        '_familiar_name_present',
        '_display_name_value',
        '_display_name_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 given_name=None,
                 surname=None,
                 familiar_name=None,
                 display_name=None):
        self._given_name_value = None
        self._given_name_present = False
        self._surname_value = None
        self._surname_present = False
        self._familiar_name_value = None
        self._familiar_name_present = False
        self._display_name_value = None
        self._display_name_present = False
        if given_name is not None:
            self.given_name = given_name
        if surname is not None:
            self.surname = surname
        if familiar_name is not None:
            self.familiar_name = familiar_name
        if display_name is not None:
            self.display_name = display_name

    @property
    def given_name(self):
        """
        Also known as a first name.

        :rtype: str
        """
        if self._given_name_present:
            return self._given_name_value
        else:
            raise AttributeError("missing required field 'given_name'")

    @given_name.setter
    def given_name(self, val):
        val = self._given_name_validator.validate(val)
        self._given_name_value = val
        self._given_name_present = True

    @given_name.deleter
    def given_name(self):
        self._given_name_value = None
        self._given_name_present = False

    @property
    def surname(self):
        """
        Also known as a last name or family name.

        :rtype: str
        """
        if self._surname_present:
            return self._surname_value
        else:
            raise AttributeError("missing required field 'surname'")

    @surname.setter
    def surname(self, val):
        val = self._surname_validator.validate(val)
        self._surname_value = val
        self._surname_present = True

    @surname.deleter
    def surname(self):
        self._surname_value = None
        self._surname_present = False

    @property
    def familiar_name(self):
        """
        Locale-dependent name. In the US, a person's familiar name is their
        ``given_name``, but elsewhere, it could be any combination of a person's
        ``given_name`` and ``surname``.

        :rtype: str
        """
        if self._familiar_name_present:
            return self._familiar_name_value
        else:
            raise AttributeError("missing required field 'familiar_name'")

    @familiar_name.setter
    def familiar_name(self, val):
        val = self._familiar_name_validator.validate(val)
        self._familiar_name_value = val
        self._familiar_name_present = True

    @familiar_name.deleter
    def familiar_name(self):
        self._familiar_name_value = None
        self._familiar_name_present = False

    @property
    def display_name(self):
        """
        A name that can be used directly to represent the name of a user's
        Dropbox account.

        :rtype: str
        """
        if self._display_name_present:
            return self._display_name_value
        else:
            raise AttributeError("missing required field 'display_name'")

    @display_name.setter
    def display_name(self, val):
        val = self._display_name_validator.validate(val)
        self._display_name_value = val
        self._display_name_present = True

    @display_name.deleter
    def display_name(self):
        self._display_name_value = None
        self._display_name_present = False

    def __repr__(self):
        return 'Name(given_name={!r}, surname={!r}, familiar_name={!r}, display_name={!r})'.format(
            self._given_name_value,
            self._surname_value,
            self._familiar_name_value,
            self._display_name_value,
        )

class SpaceUsage(object):
    """
    Information about a user's space usage and quota.

    :ivar used: The user's total space usage (bytes).
    :ivar allocation: The user's space allocation.
    """

    __slots__ = [
        '_used_value',
        '_used_present',
        '_allocation_value',
        '_allocation_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 used=None,
                 allocation=None):
        self._used_value = None
        self._used_present = False
        self._allocation_value = None
        self._allocation_present = False
        if used is not None:
            self.used = used
        if allocation is not None:
            self.allocation = allocation

    @property
    def used(self):
        """
        The user's total space usage (bytes).

        :rtype: long
        """
        if self._used_present:
            return self._used_value
        else:
            raise AttributeError("missing required field 'used'")

    @used.setter
    def used(self, val):
        val = self._used_validator.validate(val)
        self._used_value = val
        self._used_present = True

    @used.deleter
    def used(self):
        self._used_value = None
        self._used_present = False

    @property
    def allocation(self):
        """
        The user's space allocation.

        :rtype: SpaceAllocation
        """
        if self._allocation_present:
            return self._allocation_value
        else:
            raise AttributeError("missing required field 'allocation'")

    @allocation.setter
    def allocation(self, val):
        self._allocation_validator.validate_type_only(val)
        self._allocation_value = val
        self._allocation_present = True

    @allocation.deleter
    def allocation(self):
        self._allocation_value = None
        self._allocation_present = False

    def __repr__(self):
        return 'SpaceUsage(used={!r}, allocation={!r})'.format(
            self._used_value,
            self._allocation_value,
        )

class SpaceAllocation(object):
    """
    Space is allocated differently based on the type of account.

    :ivar IndividualSpaceAllocation individual: The user's space allocation
        applies only to their individual account.
    :ivar TeamSpaceAllocation team: The user shares space with other members of
        their team.
    """

    __slots__ = ['_tag', '_value']

    _catch_all = 'other'
    # Attribute is overwritten below the class definition
    other = None

    def __init__(self, tag, value=None):
        assert tag in self._tagmap, 'Invalid tag %r.' % tag
        validator = self._tagmap[tag]
        if isinstance(validator, bv.Void):
            assert value is None, 'Void type union member must have None value.'
        elif isinstance(validator, (bv.Struct, bv.Union)):
            validator.validate_type_only(value)
        else:
            validator.validate(value)
        self._tag = tag
        self._value = value

    @classmethod
    def individual(cls, val):
        return cls('individual', val)

    @classmethod
    def team(cls, val):
        return cls('team', val)

    def is_individual(self):
        return self._tag == 'individual'

    def is_team(self):
        return self._tag == 'team'

    def is_other(self):
        return self._tag == 'other'

    def get_individual(self):
        if not self.is_individual():
            raise AttributeError("tag 'individual' not set")
        return self._value

    def get_team(self):
        if not self.is_team():
            raise AttributeError("tag 'team' not set")
        return self._value

    def __repr__(self):
        return 'SpaceAllocation(%r)' % self._tag

class IndividualSpaceAllocation(object):
    """
    :ivar allocated: The total space allocated to the user's account (bytes).
    """

    __slots__ = [
        '_allocated_value',
        '_allocated_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 allocated=None):
        self._allocated_value = None
        self._allocated_present = False
        if allocated is not None:
            self.allocated = allocated

    @property
    def allocated(self):
        """
        The total space allocated to the user's account (bytes).

        :rtype: long
        """
        if self._allocated_present:
            return self._allocated_value
        else:
            raise AttributeError("missing required field 'allocated'")

    @allocated.setter
    def allocated(self, val):
        val = self._allocated_validator.validate(val)
        self._allocated_value = val
        self._allocated_present = True

    @allocated.deleter
    def allocated(self):
        self._allocated_value = None
        self._allocated_present = False

    def __repr__(self):
        return 'IndividualSpaceAllocation(allocated={!r})'.format(
            self._allocated_value,
        )

class TeamSpaceAllocation(object):
    """
    :ivar used: The total space currently used by the user's team (bytes).
    :ivar allocated: The total space allocated to the user's team (bytes).
    """

    __slots__ = [
        '_used_value',
        '_used_present',
        '_allocated_value',
        '_allocated_present',
    ]

    _has_required_fields = True

    def __init__(self,
                 used=None,
                 allocated=None):
        self._used_value = None
        self._used_present = False
        self._allocated_value = None
        self._allocated_present = False
        if used is not None:
            self.used = used
        if allocated is not None:
            self.allocated = allocated

    @property
    def used(self):
        """
        The total space currently used by the user's team (bytes).

        :rtype: long
        """
        if self._used_present:
            return self._used_value
        else:
            raise AttributeError("missing required field 'used'")

    @used.setter
    def used(self, val):
        val = self._used_validator.validate(val)
        self._used_value = val
        self._used_present = True

    @used.deleter
    def used(self):
        self._used_value = None
        self._used_present = False

    @property
    def allocated(self):
        """
        The total space allocated to the user's team (bytes).

        :rtype: long
        """
        if self._allocated_present:
            return self._allocated_value
        else:
            raise AttributeError("missing required field 'allocated'")

    @allocated.setter
    def allocated(self, val):
        val = self._allocated_validator.validate(val)
        self._allocated_value = val
        self._allocated_present = True

    @allocated.deleter
    def allocated(self):
        self._allocated_value = None
        self._allocated_present = False

    def __repr__(self):
        return 'TeamSpaceAllocation(used={!r}, allocated={!r})'.format(
            self._used_value,
            self._allocated_value,
        )

GetAccountArg._account_id_validator = bv.String(min_length=40, max_length=40)
GetAccountArg._all_field_names_ = set(['account_id'])
GetAccountArg._all_fields_ = [('account_id', GetAccountArg._account_id_validator)]

GetAccountError._no_account_validator = bv.Void()
GetAccountError._unknown_validator = bv.Void()
GetAccountError._tagmap = {
    'no_account': GetAccountError._no_account_validator,
    'unknown': GetAccountError._unknown_validator,
}

GetAccountError.no_account = GetAccountError('no_account')
GetAccountError.unknown = GetAccountError('unknown')

AccountType._basic_validator = bv.Void()
AccountType._pro_validator = bv.Void()
AccountType._business_validator = bv.Void()
AccountType._tagmap = {
    'basic': AccountType._basic_validator,
    'pro': AccountType._pro_validator,
    'business': AccountType._business_validator,
}

AccountType.basic = AccountType('basic')
AccountType.pro = AccountType('pro')
AccountType.business = AccountType('business')

Account._account_id_validator = bv.String(min_length=40, max_length=40)
Account._name_validator = bv.Struct(Name)
Account._all_field_names_ = set([
    'account_id',
    'name',
])
Account._all_fields_ = [
    ('account_id', Account._account_id_validator),
    ('name', Account._name_validator),
]

BasicAccount._is_teammate_validator = bv.Boolean()
BasicAccount._all_field_names_ = Account._all_field_names_.union(set(['is_teammate']))
BasicAccount._all_fields_ = Account._all_fields_ + [('is_teammate', BasicAccount._is_teammate_validator)]

FullAccount._email_validator = bv.String()
FullAccount._country_validator = bv.Nullable(bv.String(min_length=2, max_length=2))
FullAccount._locale_validator = bv.String(min_length=2, max_length=2)
FullAccount._referral_link_validator = bv.String()
FullAccount._team_validator = bv.Nullable(bv.Struct(Team))
FullAccount._is_paired_validator = bv.Boolean()
FullAccount._account_type_validator = bv.Union(AccountType)
FullAccount._all_field_names_ = Account._all_field_names_.union(set([
    'email',
    'country',
    'locale',
    'referral_link',
    'team',
    'is_paired',
    'account_type',
]))
FullAccount._all_fields_ = Account._all_fields_ + [
    ('email', FullAccount._email_validator),
    ('country', FullAccount._country_validator),
    ('locale', FullAccount._locale_validator),
    ('referral_link', FullAccount._referral_link_validator),
    ('team', FullAccount._team_validator),
    ('is_paired', FullAccount._is_paired_validator),
    ('account_type', FullAccount._account_type_validator),
]

Team._id_validator = bv.String()
Team._name_validator = bv.String()
Team._all_field_names_ = set([
    'id',
    'name',
])
Team._all_fields_ = [
    ('id', Team._id_validator),
    ('name', Team._name_validator),
]

Name._given_name_validator = bv.String()
Name._surname_validator = bv.String()
Name._familiar_name_validator = bv.String()
Name._display_name_validator = bv.String()
Name._all_field_names_ = set([
    'given_name',
    'surname',
    'familiar_name',
    'display_name',
])
Name._all_fields_ = [
    ('given_name', Name._given_name_validator),
    ('surname', Name._surname_validator),
    ('familiar_name', Name._familiar_name_validator),
    ('display_name', Name._display_name_validator),
]

SpaceUsage._used_validator = bv.UInt64()
SpaceUsage._allocation_validator = bv.Union(SpaceAllocation)
SpaceUsage._all_field_names_ = set([
    'used',
    'allocation',
])
SpaceUsage._all_fields_ = [
    ('used', SpaceUsage._used_validator),
    ('allocation', SpaceUsage._allocation_validator),
]

SpaceAllocation._individual_validator = bv.Struct(IndividualSpaceAllocation)
SpaceAllocation._team_validator = bv.Struct(TeamSpaceAllocation)
SpaceAllocation._other_validator = bv.Void()
SpaceAllocation._tagmap = {
    'individual': SpaceAllocation._individual_validator,
    'team': SpaceAllocation._team_validator,
    'other': SpaceAllocation._other_validator,
}

SpaceAllocation.other = SpaceAllocation('other')

IndividualSpaceAllocation._allocated_validator = bv.UInt64()
IndividualSpaceAllocation._all_field_names_ = set(['allocated'])
IndividualSpaceAllocation._all_fields_ = [('allocated', IndividualSpaceAllocation._allocated_validator)]

TeamSpaceAllocation._used_validator = bv.UInt64()
TeamSpaceAllocation._allocated_validator = bv.UInt64()
TeamSpaceAllocation._all_field_names_ = set([
    'used',
    'allocated',
])
TeamSpaceAllocation._all_fields_ = [
    ('used', TeamSpaceAllocation._used_validator),
    ('allocated', TeamSpaceAllocation._allocated_validator),
]


text:
<?php

namespace Artesaos\SEOTools\Facades;

use Illuminate\Support\Facades\Facade;

/**
 * SEOTools is a facade for the `SEOTools` implementation access.
 *
 * @see \Artesaos\SEOTools\Contracts\SEOTools
 *
 * @method static string generate(bool $minify = false)
 * @method static \Artesaos\SEOTools\Contracts\MetaTags metatags()
 * @method static \Artesaos\SEOTools\Contracts\OpenGraph opengraph()
 * @method static \Artesaos\SEOTools\Contracts\TwitterCards twitter()
 * @method static \Artesaos\SEOTools\Contracts\JsonLd jsonLd()
 * @method static \Artesaos\SEOTools\Contracts\JsonLdMulti jsonLdMulti()
 * @method static \Artesaos\SEOTools\Contracts\SEOTools setTitle(string $title, bool $appendDefault = true)
 * @method static \Artesaos\SEOTools\Contracts\SEOTools setDescription(string $description)
 * @method static \Artesaos\SEOTools\Contracts\SEOTools setCanonical(string $url)
 * @method static \Artesaos\SEOTools\Contracts\SEOTools addImages(array $urls)
 * @method static string getTitle(bool $session = false)
 */
class SEOTools extends Facade
{
    /**
     * {@inheritdoc}
     */
    protected static function getFacadeAccessor()
    {
        return 'seotools';
    }
}

redpajama_set_name: RedPajamaGithub


text:
@implementation CHTTPMessage (CHTTPMessage_ConvenienceExtensions)

+ (NSString *)statusDescriptionForStatusCode:(NSInteger)inStatusCode;
{
switch (inStatusCode)
	{
	case 100: return(@"Continue");
	case 101: return(@"caseing Protocols");
	case 200: return(@"OK");
	case 201: return(@"Created");
	case 202: return(@"Accepted");
	case 203: return(@"Non-Authoritative Information");
	case 204: return(@"No Content");
	case 205: return(@"Reset Content");
	case 206: return(@"Partial Content");
	case 300: return(@"Multiple Choices");
	case 301: return(@"Moved Permanently");
	case 302: return(@"Found");
	case 303: return(@"See Other");
	case 304: return(@"Not Modified");
	case 305: return(@"Use Proxy");
	case 306: return(@"case Proxy");
	case 307: return(@"Temporary Redirect");
	case 400: return(@"Bad Request");
	case 401: return(@"Unauthorized");
	case 402: return(@"Payment Required");
	case 403: return(@"Forbidden");
	case 404: return(@"Not Found");
	case 405: return(@"Method Not Allowed");
	case 406: return(@"Not Acceptable");
	case 407: return(@"Proxy Authentication Required");
	case 408: return(@"Request Timeout");
	case 409: return(@"Conflict");
	case 410: return(@"Gone");
	case 411: return(@"Length Required");
	case 412: return(@"Precondition Failed");
	case 413: return(@"Request Entity Too Large");
	case 414: return(@"Request-URI Too Long");
	case 415: return(@"Unsupported Media Type");
	case 416: return(@"Requested Range Not Satisfiable");
	case 417: return(@"Expectation Failed");
	case kHTTPStatusCode_InternalServerError: return(@"Internal Server Error");
	case 501: return(@"Not Implemented");
	case 502: return(@"Bad Gateway");
	case 503: return(@"Service Unavailable");
	case 504: return(@"Gateway Timeout");
	case 505: return(@"HTTP Version Not Supported");

	case 102: return(@"Processing");
	case 207: return(@"Multi-Status");
	case 422: return(@"Unprocessable Entity");
	case 423: return(@"Locked");
	case 424: return(@"Failed Dependency");
	case 425: return(@"Unordered Collection");
	case 507: return(@"Insufficient Storage");

	case 418: return(@"I'm a Teapot");
	case 426: return(@"Upgrade Required");
	case 449: return(@"Retry With");
	case 450: return(@"Blocked");
	case 506: return(@"Variant Also Negotiates");
	case 509: return(@"Bandwidth Limit Exceeded");
	case 510: return(@"Not Extended");
	}
return(NULL);
}

+ (CHTTPMessage *)HTTPMessageResponseWithStatusCode:(NSInteger)inStatusCode
{
CHTTPMessage *theHTTPMessage = [[self alloc] init];

NSString *theStatusDescription = [[self class] statusDescriptionForStatusCode:inStatusCode];

theHTTPMessage.message = CFHTTPMessageCreateResponse(kCFAllocatorDefault, inStatusCode, (__bridge CFStringRef)theStatusDescription, (__bridge CFStringRef)kHTTPVersion1_1);
[theHTTPMessage setHeader:@"0" forKey:@"Content-Length"];
return(theHTTPMessage);
}

+ (CHTTPMessage *)HTTPMessageResponseWithStatusCode:(NSInteger)inStatusCode bodyString:(NSString *)inBodyString
{
CHTTPMessage *theHTTPMessage = [self HTTPMessageResponseWithStatusCode:inStatusCode];

[theHTTPMessage setContentType:@"text/plain" bodyData:[inBodyString dataUsingEncoding:NSUTF8StringEncoding]];

return(theHTTPMessage);
}

+ (CHTTPMessage *)HTTPMessageResponseWithError:(NSError *)inError
{
NSInteger theStatusCode = kHTTPStatusCode_InternalServerError;
if ([inError.domain isEqualToString:kHTTPErrorDomain])
	{
	theStatusCode = inError.code;
	}

CHTTPMessage *theHTTPMessage = [self HTTPMessageResponseWithStatusCode:theStatusCode];

NSData *theData = [inError asXMLData];
[theHTTPMessage setContentType:@"text/xml" bodyData:theData];
return(theHTTPMessage);
}

#pragma mark -

- (NSString *)contentType
{
return([self headerForKey:@"Content-Type"]);
}

- (void)setContentType:(NSString *)inContentType
{
return([self setHeader:inContentType forKey:@"Content-Type"]);
}

- (NSInteger)contentLength
{
// JIWTODO is this too simplistic?
return([[self headerForKey:@"Content-Length"] integerValue]);
}

- (void)setContentLength:(NSInteger)inContentLength
{
[self setHeader:[NSString stringWithFormat:@"%d", inContentLength] forKey:@"Content-Length"];
}

#pragma mark -

- (NSArray *)headerComponentsForKey:(NSString *)inKey
{
NSString *theHeader = [self headerForKey:inKey];
NSArray *theComponents = [theHeader componentsSeparatedByString:@";"];
return(theComponents);
}

- (NSString *)mainHeaderComponentForKey:(NSString *)inKey
{
NSArray *theComponents = [self headerComponentsForKey:inKey];
if ([theComponents count] < 1)
	return(NULL);
else
	return([theComponents objectAtIndex:0]);
}

- (void)setContentType:(NSString *)inContentType bodyData:(NSData *)inBodyData
{
[self setHeader:inContentType forKey:@"Content-Type"];
self.contentLength = inBodyData.length;
[self setBodyData:inBodyData];
}

- (NSString *)bodyString
{
return([[NSString alloc] initWithData:self.bodyData encoding:NSUTF8StringEncoding]);
}

@end


text:
import {Directive, Input, OnChanges, SimpleChanges, StaticProvider, forwardRef} from '@angular/core';
import {Observable} from 'rxjs';

import {AbstractControl} from '../model';
import {NG_VALIDATORS, Validators} from '../validators';

/** @experimental */
export type ValidationErrors = {
  [key: string]: any
};

/**
 * An interface that can be implemented by classes that can act as validators.
 *
 * ## Usage
 *
 * ```typescript
 * @Directive({
 *   selector: '[custom-validator]',
 *   providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}]
 * })
 * class CustomValidatorDirective implements Validator {
 *   validate(c: Control): {[key: string]: any} {
 *     return {"custom": true};
 *   }
 * }
 * ```
 *
 * @stable
 */
export interface Validator {
  validate(c: AbstractControl): ValidationErrors|null;
  registerOnValidatorChange?(fn: () => void): void;
}

/** @experimental */
export interface AsyncValidator extends Validator {
  validate(c: AbstractControl): Promise<ValidationErrors|null>|Observable<ValidationErrors|null>;
}

export const REQUIRED_VALIDATOR: StaticProvider = {
  provide: NG_VALIDATORS,
  useExisting: forwardRef(() => RequiredValidator),
  multi: true
};

export const CHECKBOX_REQUIRED_VALIDATOR: StaticProvider = {
  provide: NG_VALIDATORS,
  useExisting: forwardRef(() => CheckboxRequiredValidator),
  multi: true
};

/**
 * A Directive that adds the `required` validator to any controls marked with the
 * `required` attribute, via the {@link NG_VALIDATORS} binding.
 *
 * ### Example
 *
 * ```
 * <input name="fullName" ngModel required>
 * ```
 *
 * @stable
 */
@Directive({
  selector:
      ':not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]',
  providers: [REQUIRED_VALIDATOR],
  host: {'[attr.required]': 'required ? "" : null'}
})
export class RequiredValidator implements Validator {
  private _required: boolean;
  private _onChange: () => void;

  @Input()
  get required(): boolean|string { return this._required; }

  set required(value: boolean|string) {
    this._required = value != null && value !== false && `${value}` !== 'false';
    if (this._onChange) this._onChange();
  }

  validate(c: AbstractControl): ValidationErrors|null {
    return this.required ? Validators.required(c) : null;
  }

  registerOnValidatorChange(fn: () => void): void { this._onChange = fn; }
}

/**
 * A Directive that adds the `required` validator to checkbox controls marked with the
 * `required` attribute, via the {@link NG_VALIDATORS} binding.
 *
 * ### Example
 *
 * ```
 * <input type="checkbox" name="active" ngModel required>
 * ```
 *
 * @experimental
 */
@Directive({
  selector:
      'input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]',
  providers: [CHECKBOX_REQUIRED_VALIDATOR],
  host: {'[attr.required]': 'required ? "" : null'}
})
export class CheckboxRequiredValidator extends RequiredValidator {
  validate(c: AbstractControl): ValidationErrors|null {
    return this.required ? Validators.requiredTrue(c) : null;
  }
}

/**
 * Provider which adds {@link EmailValidator} to {@link NG_VALIDATORS}.
 */
export const EMAIL_VALIDATOR: any = {
  provide: NG_VALIDATORS,
  useExisting: forwardRef(() => EmailValidator),
  multi: true
};

/**
 * A Directive that adds the `email` validator to controls marked with the
 * `email` attribute, via the {@link NG_VALIDATORS} binding.
 *
 * ### Example
 *
 * ```
 * <input type="email" name="email" ngModel email>
 * <input type="email" name="email" ngModel email="true">
 * <input type="email" name="email" ngModel [email]="true">
 * ```
 *
 * @experimental
 */
@Directive({
  selector: '[email][formControlName],[email][formControl],[email][ngModel]',
  providers: [EMAIL_VALIDATOR]
})
export class EmailValidator implements Validator {
  private _enabled: boolean;
  private _onChange: () => void;

  @Input()
  set email(value: boolean|string) {
    this._enabled = value === '' || value === true || value === 'true';
    if (this._onChange) this._onChange();
  }

  validate(c: AbstractControl): ValidationErrors|null {
    return this._enabled ? Validators.email(c) : null;
  }

  registerOnValidatorChange(fn: () => void): void { this._onChange = fn; }
}

/**
 * @stable
 */
export interface ValidatorFn { (c: AbstractControl): ValidationErrors|null; }

/**
 * @stable
 */
export interface AsyncValidatorFn {
  (c: AbstractControl): Promise<ValidationErrors|null>|Observable<ValidationErrors|null>;
}

/**
 * Provider which adds {@link MinLengthValidator} to {@link NG_VALIDATORS}.
 *
 * ## Example:
 *
 * {@example common/forms/ts/validators/validators.ts region='min'}
 */
export const MIN_LENGTH_VALIDATOR: any = {
  provide: NG_VALIDATORS,
  useExisting: forwardRef(() => MinLengthValidator),
  multi: true
};

/**
 * A directive which installs the {@link MinLengthValidator} for any `formControlName`,
 * `formControl`, or control with `ngModel` that also has a `minlength` attribute.
 *
 * @stable
 */
@Directive({
  selector: '[minlength][formControlName],[minlength][formControl],[minlength][ngModel]',
  providers: [MIN_LENGTH_VALIDATOR],
  host: {'[attr.minlength]': 'minlength ? minlength : null'}
})
export class MinLengthValidator implements Validator,
    OnChanges {
  private _validator: ValidatorFn;
  private _onChange: () => void;

  @Input() minlength: string;

  ngOnChanges(changes: SimpleChanges): void {
    if ('minlength' in changes) {
      this._createValidator();
      if (this._onChange) this._onChange();
    }
  }

  validate(c: AbstractControl): ValidationErrors|null {
    return this.minlength == null ? null : this._validator(c);
  }

  registerOnValidatorChange(fn: () => void): void { this._onChange = fn; }

  private _createValidator(): void {
    this._validator = Validators.minLength(parseInt(this.minlength, 10));
  }
}

/**
 * Provider which adds {@link MaxLengthValidator} to {@link NG_VALIDATORS}.
 *
 * ## Example:
 *
 * {@example common/forms/ts/validators/validators.ts region='max'}
 */
export const MAX_LENGTH_VALIDATOR: any = {
  provide: NG_VALIDATORS,
  useExisting: forwardRef(() => MaxLengthValidator),
  multi: true
};

/**
 * A directive which installs the {@link MaxLengthValidator} for any `formControlName,
 * `formControl`,
 * or control with `ngModel` that also has a `maxlength` attribute.
 *
 * @stable
 */
@Directive({
  selector: '[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]',
  providers: [MAX_LENGTH_VALIDATOR],
  host: {'[attr.maxlength]': 'maxlength ? maxlength : null'}
})
export class MaxLengthValidator implements Validator,
    OnChanges {
  private _validator: ValidatorFn;
  private _onChange: () => void;

  @Input() maxlength: string;

  ngOnChanges(changes: SimpleChanges): void {
    if ('maxlength' in changes) {
      this._createValidator();
      if (this._onChange) this._onChange();
    }
  }

  validate(c: AbstractControl): ValidationErrors|null {
    return this.maxlength != null ? this._validator(c) : null;
  }

  registerOnValidatorChange(fn: () => void): void { this._onChange = fn; }

  private _createValidator(): void {
    this._validator = Validators.maxLength(parseInt(this.maxlength, 10));
  }
}

export const PATTERN_VALIDATOR: any = {
  provide: NG_VALIDATORS,
  useExisting: forwardRef(() => PatternValidator),
  multi: true
};

/**
 * A Directive that adds the `pattern` validator to any controls marked with the
 * `pattern` attribute, via the {@link NG_VALIDATORS} binding. Uses attribute value
 * as the regex to validate Control value against.  Follows pattern attribute
 * semantics; i.e. regex must match entire Control value.
 *
 * ### Example
 *
 * ```
 * <input [name]="fullName" pattern="[a-zA-Z ]*" ngModel>
 * ```
 * @stable
 */
@Directive({
  selector: '[pattern][formControlName],[pattern][formControl],[pattern][ngModel]',
  providers: [PATTERN_VALIDATOR],
  host: {'[attr.pattern]': 'pattern ? pattern : null'}
})
export class PatternValidator implements Validator,
    OnChanges {
  private _validator: ValidatorFn;
  private _onChange: () => void;

  @Input() pattern: string|RegExp;

  ngOnChanges(changes: SimpleChanges): void {
    if ('pattern' in changes) {
      this._createValidator();
      if (this._onChange) this._onChange();
    }
  }

  validate(c: AbstractControl): ValidationErrors|null { return this._validator(c); }

  registerOnValidatorChange(fn: () => void): void { this._onChange = fn; }

  private _createValidator(): void { this._validator = Validators.pattern(this.pattern); }
}


text:
{% extends "list.html" %}
{% block content %}

    {{ form }}

{% endblock %}


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

<sect1 id="learning.paginator.control">
    <title>Contrôles de la pagination et styles de défilement</title>

    <para>
        Rendre visuellement les éléments d'une page est un bon départ. Dans les sections précédentes, nous
        avons aperçu la méthode <methodname>setCurrentPageNumber()</methodname> pour déterminer la page active.
        Le point suivant est la navigation au travers de ces pages. Le paginateur vous fournit des outils
        pour ça comme la possibilité de rendre un script de vue partiel et le support des styles de
        défilement (ScrollingStyles).
    </para>

    <para>
        La vue partiel est un bout de vue qui rend juste les contrôles de la pagination comme les boutons suivant
        et précédent. Le design de la vue partielle est libre, il vous faudra simplement un objet Zend_View.
        Commencez donc par créer un nouveau script de vue dans le dossier des scripts de vue. Vous pouvez
        l'appeler comme vous voulez, nous l'appellerons "controls.phtml" de notre coté. Le manuel comporte
        des exemples de tels scripts, en voici un.
    </para>

    <programlisting language="php"><![CDATA[
<?php if ($this->pageCount): ?>

<?php if (isset($this->previous)): ?>
  <a href="<?php echo $this->url(array('page' => $this->first)); ?>">
    First
   |
<?php else: ?>
  First |
<?php endif; ?>

<?php if (isset($this->previous)): ?>
  <a href="<?php echo $this->url(array('page' => $this->previous)); ?>">
    < Previous
   |
<?php else: ?>
  < Previous |
<?php endif; ?>

<?php if (isset($this->next)): ?>
  <a href="<?php echo $this->url(array('page' => $this->next)); ?>">
    Next >
   |
<?php else: ?>
  Next > |
<?php endif; ?>

<?php if (isset($this->next)): ?>
  <a href="<?php echo $this->url(array('page' => $this->last)); ?>">
    Last

<?php else: ?>
  Last
<?php endif; ?>

<?php endif; ?>
]]></programlisting>

    <para>
        Il faut maintenant indiquer à Zend_Paginator la vue partielle à utiliser. Ajoutez ceci à votre
        bootstrap:
    </para>

    <programlisting language="php"><![CDATA[
Zend_View_Helper_PaginationControl::setDefaultViewPartial('controls.phtml');
]]></programlisting>

    <para>
        La dernière étape est la plus simple. Passez un objet Paginator à un script de vue
        (PAS 'controls.phtml'!). Ensuite, demandez simplement l'affichage de l'objet Paginator
        lui-même. Ceci va faire intervenir l'aide de vue PaginationControl. Dans l'exemple qui suit,
        l'objet Paginator a été affecté comme variable de vue 'paginator'. Ne vous inquiétez pas
        si vous ne comprenez pas totalement le fonctionnement, les sections suivantes le détaillent.
    </para>

    <programlisting language="php"><![CDATA[
<?php echo $this->paginator; ?>
]]></programlisting>

    <para>
        Pour décider quels numéros de page afficher, le paginateur utilise des styles de défilement.
        Le style par défaut est "Sliding", qui ressemble à la présentation des résultats de Yahoo!
        Un style ressemblant à Google est "Elastic". Le style par défaut se règle au moyen de la méthode
        statique <methodname>setDefaultScrollingStyle()</methodname>, ou lors du rendu du paginateur
        dans le script de vue mais ceci nécessite un appel manuel à l'aide de vue.
    </para>

    <programlisting language="php"><![CDATA[
// $this->paginator est un objet Paginator
<?php echo $this->paginationControl($this->paginator, 'Elastic', 'controls.phtml'); ?>
]]></programlisting>

    <para>
        Pour une liste de tous les styles de défilement, consultez le manuel.
    </para>
</sect1>


text:
#pragma once

#include "SVGAnimatedBoolean.h"
#include "SVGExternalResourcesRequired.h"
#include "SVGSMILElement.h"
#include "SVGTests.h"
#include "UnitBezier.h"

namespace WebCore {

class ConditionEventListener;
class SVGAnimatedType;
class TimeContainer;

enum AnimationMode {
    NoAnimation,
    FromToAnimation,
    FromByAnimation,
    ToAnimation,
    ByAnimation,
    ValuesAnimation,
    PathAnimation // Used by AnimateMotion.
};

// If we have 'currentColor' or 'inherit' as animation value, we need to grab
// the value during the animation since the value can be animated itself.
enum AnimatedPropertyValueType { RegularPropertyValue, CurrentColorValue, InheritValue };

enum class CalcMode { Discrete, Linear, Paced, Spline };

class SVGAnimationElement : public SVGSMILElement, public SVGTests, public SVGExternalResourcesRequired {
public:
    float getStartTime() const;
    float getCurrentTime() const;
    float getSimpleDuration() const;

    void beginElement();
    void beginElementAt(float offset);
    void endElement();
    void endElementAt(float offset);

    static bool isTargetAttributeCSSProperty(SVGElement*, const QualifiedName&);

    bool isAdditive() const override;
    bool isAccumulated() const;
    AnimationMode animationMode() const { return m_animationMode; }
    CalcMode calcMode() const { return m_calcMode; }

    enum ShouldApplyAnimation {
        DontApplyAnimation,
        ApplyCSSAnimation,
        ApplyXMLAnimation,
        ApplyXMLandCSSAnimation // For presentation attributes with SVG DOM properties.
    };

    ShouldApplyAnimation shouldApplyAnimation(SVGElement* targetElement, const QualifiedName& attributeName);

    AnimatedPropertyValueType fromPropertyValueType() const { return m_fromPropertyValueType; }
    AnimatedPropertyValueType toPropertyValueType() const { return m_toPropertyValueType; }

    template<typename AnimatedType> void adjustForInheritance(AnimatedType (*parseTypeFromString)(SVGAnimationElement*, const String&), AnimatedPropertyValueType valueType, AnimatedType& animatedType, SVGElement* contextElement)
    {
        if (valueType != InheritValue)
            return;
        // Replace 'inherit' by its computed property value.
        ASSERT(parseTypeFromString);
        String typeString;
        adjustForInheritance(contextElement, attributeName(), typeString);
        animatedType = (*parseTypeFromString)(this, typeString);
    }

    template<typename AnimatedType> bool adjustFromToListValues(const AnimatedType& fromList, const AnimatedType& toList, AnimatedType& animatedList, float percentage, bool resizeAnimatedListIfNeeded = true)
    {
        // If no 'to' value is given, nothing to animate.
        unsigned toListSize = toList.size();
        if (!toListSize)
            return false;

        // If the 'from' value is given and it's length doesn't match the 'to' value list length, fallback to a discrete animation.
        unsigned fromListSize = fromList.size();
        if (fromListSize != toListSize && fromListSize) {
            if (percentage < 0.5) {
                if (animationMode() != ToAnimation)
                    animatedList = AnimatedType(fromList);
            } else
                animatedList = AnimatedType(toList);

            return false;
        }

        ASSERT(!fromListSize || fromListSize == toListSize);
        if (resizeAnimatedListIfNeeded && animatedList.size() < toListSize)
            animatedList.resize(toListSize);

        return true;
    }

    template<typename AnimatedType> void animateDiscreteType(float percentage, const AnimatedType& fromType, const AnimatedType& toType, AnimatedType& animatedType)
    {
        if ((animationMode() == FromToAnimation && percentage > 0.5) || animationMode() == ToAnimation || percentage == 1) {
            animatedType = AnimatedType(toType);
            return;
        }
        animatedType = AnimatedType(fromType);
    }

    void animateAdditiveNumber(float percentage, unsigned repeatCount, float fromNumber, float toNumber, float toAtEndOfDurationNumber, float& animatedNumber)
    {
        float number;
        if (calcMode() == CalcMode::Discrete)
            number = percentage < 0.5 ? fromNumber : toNumber;
        else
            number = (toNumber - fromNumber) * percentage + fromNumber;

        if (isAccumulated() && repeatCount)
            number += toAtEndOfDurationNumber * repeatCount;

        if (isAdditive() && animationMode() != ToAnimation)
            animatedNumber += number;
        else
            animatedNumber = number;
    }

    // SVGTests
    Ref<SVGStringList> requiredFeatures();
    Ref<SVGStringList> requiredExtensions();
    Ref<SVGStringList> systemLanguage();

protected:
    SVGAnimationElement(const QualifiedName&, Document&);

    void computeCSSPropertyValue(SVGElement*, CSSPropertyID, String& value);
    virtual void determinePropertyValueTypes(const String& from, const String& to);
    virtual void resetAnimatedPropertyType();

    static bool isSupportedAttribute(const QualifiedName&);
    void parseAttribute(const QualifiedName&, const AtomicString&) override;
    void svgAttributeChanged(const QualifiedName&) override;

    enum class AttributeType { CSS, XML, Auto };
    AttributeType attributeType() const { return m_attributeType; }

    String toValue() const;
    String byValue() const;
    String fromValue() const;

    String targetAttributeBaseValue();

    // from SVGSMILElement
    void startedActiveInterval() override;
    void updateAnimation(float percent, unsigned repeat, SVGSMILElement* resultElement) override;

    AnimatedPropertyValueType m_fromPropertyValueType { RegularPropertyValue };
    AnimatedPropertyValueType m_toPropertyValueType { RegularPropertyValue };

    void setTargetElement(SVGElement*) override;
    void setAttributeName(const QualifiedName&) override { }
    bool hasInvalidCSSAttributeType() const { return m_hasInvalidCSSAttributeType; }
    void checkInvalidCSSAttributeType(SVGElement*);

    virtual void updateAnimationMode();
    void setAnimationMode(AnimationMode animationMode) { m_animationMode = animationMode; }
    void setCalcMode(CalcMode calcMode) { m_calcMode = calcMode; }

private:
    void animationAttributeChanged() override;
    void setAttributeType(const AtomicString&);

    virtual bool calculateToAtEndOfDurationValue(const String& toAtEndOfDurationString) = 0;
    virtual bool calculateFromAndToValues(const String& fromString, const String& toString) = 0;
    virtual bool calculateFromAndByValues(const String& fromString, const String& byString) = 0;
    virtual void calculateAnimatedValue(float percent, unsigned repeatCount, SVGSMILElement* resultElement) = 0;
    virtual float calculateDistance(const String& /*fromString*/, const String& /*toString*/) { return -1.f; }

    void currentValuesForValuesAnimation(float percent, float& effectivePercent, String& from, String& to);
    void calculateKeyTimesForCalcModePaced();
    float calculatePercentFromKeyPoints(float percent) const;
    void currentValuesFromKeyPoints(float percent, float& effectivePercent, String& from, String& to) const;
    float calculatePercentForSpline(float percent, unsigned splineIndex) const;
    float calculatePercentForFromTo(float percent) const;
    unsigned calculateKeyTimesIndex(float percent) const;

    void applyAnimatedValue(ShouldApplyAnimation, SVGElement* targetElement, const QualifiedName& attributeName, SVGAnimatedType*);
    void adjustForInheritance(SVGElement* targetElement, const QualifiedName& attributeName, String&);

    BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGAnimationElement)
        DECLARE_ANIMATED_BOOLEAN_OVERRIDE(ExternalResourcesRequired, externalResourcesRequired)
    END_DECLARE_ANIMATED_PROPERTIES

    // SVGTests
    void synchronizeRequiredFeatures() final { SVGTests::synchronizeRequiredFeatures(*this); }
    void synchronizeRequiredExtensions() final { SVGTests::synchronizeRequiredExtensions(*this); }
    void synchronizeSystemLanguage() final { SVGTests::synchronizeSystemLanguage(*this); }

    void setCalcMode(const AtomicString&);

    bool m_animationValid { false };

    AttributeType m_attributeType { AttributeType::Auto };
    Vector<String> m_values;
    Vector<float> m_keyTimes;
    Vector<float> m_keyPoints;
    Vector<UnitBezier> m_keySplines;
    String m_lastValuesAnimationFrom;
    String m_lastValuesAnimationTo;
    bool m_hasInvalidCSSAttributeType { false };
    CalcMode m_calcMode { CalcMode::Linear };
    AnimationMode m_animationMode { NoAnimation };
};

} // namespace WebCore


text:
package network

/**
* Binding class showing the vxlan that can be bound to vxlanvlanmap.
*/
type Vxlanvlanmapvxlanbinding struct {
	/**
	* The VXLAN assigned to the vlan inside the cloud.
	*/
	Vxlan int `json:"vxlan,omitempty"`
	/**
	* The vlan id or the range of vlan ids in the on-premise network.
	*/
	Vlan []string `json:"vlan,omitempty"`
	/**
	* Name of the mapping table.
	*/
	Name string `json:"name,omitempty"`

}


text:
package Client.Windows;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.event.ActionListener;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JTextField;

import Library.FontLibrary;
import Library.ImageLibrary;
import Library.PaintedButton;
import Server.Request.Authenticate;

public class LoginWindow extends JPanel{
	private static final long serialVersionUID = 1L;

	/// MEMBER VARIABLES
	private JTextField usernameField,passwordField;
	private PaintedButton loginButton;
	private JLabel errorLabel;

	public LoginWindow(ActionListener loginAction){
		initializeVariables();
		createGUI();
		loginButton.addActionListener(loginAction);
		usernameField.addActionListener(loginAction);
		passwordField.addActionListener(loginAction);
	}

	private void createGUI() {
		setLayout(new GridBagLayout());
		GridBagConstraints gbc = new GridBagConstraints();
		gbc.insets = new Insets(10,10,10,10);

		JPanel usernamePanel = new JPanel();
		usernamePanel.setOpaque(false);
		usernamePanel.setLayout(new FlowLayout());
		JLabel usernameLabel = new JLabel("Username: ");
		usernameLabel.setFont(FontLibrary.getFont("fonts/optimus.ttf", Font.PLAIN, 20));
		usernameLabel.setForeground(Color.WHITE);
		usernamePanel.add(usernameLabel);
		usernamePanel.add(usernameField);

		gbc.gridy = 1;
		add(usernamePanel, gbc);

		JPanel passwordPanel = new JPanel();
		passwordPanel.setOpaque(false);
		passwordPanel.setLayout(new FlowLayout());
		JLabel passwordLabel = new JLabel("Password: ");
		passwordLabel.setFont(FontLibrary.getFont("fonts/optimus.ttf", Font.PLAIN, 20));
		passwordLabel.setForeground(Color.WHITE);
		passwordPanel.add(passwordLabel);
		passwordPanel.add(passwordField);

		gbc.gridy = 2;
		add(passwordPanel, gbc);

		gbc.gridy = 3;
		add(errorLabel, gbc);

		gbc.gridy = 4;
		add(loginButton, gbc);
	}

	private void initializeVariables() {
		usernameField = new JTextField(20);
		usernameField.setText("JMunoz");
		usernameField.setFont(FontLibrary.getFont("fonts/optimus.ttf", Font.PLAIN, 18));
		passwordField = new JPasswordField(20);
		passwordField.setText("american12");
		errorLabel = new JLabel(" ");
		errorLabel.setForeground(Color.WHITE);
		errorLabel.setFont(FontLibrary.getFont("fonts/optimus.ttf", Font.PLAIN, 20));
		loginButton = new PaintedButton("Login", ImageLibrary.getImage("images/button_image_white.png"), 20);
		loginButton.setFont(FontLibrary.getFont("fonts/optimus.ttf", Font.PLAIN, 20));
		loginButton.setBorder(BorderFactory.createEmptyBorder());
		loginButton.setPreferredSize(new Dimension(100,30));
	}

	public void errorMessage(String message){
		errorLabel.setText(message);
	}

	public Authenticate getAuthenticate() {
		return new Authenticate(usernameField.getText(),passwordField.getText());
	}

	public String getUsername(){
		return usernameField.getText();
	}

	public String getPassword(){
		return passwordField.getText();
	}

	@Override
	public void paintComponent(Graphics g){
		super.paintComponent(g);
		g.drawImage(ImageLibrary.getImage("images/background_texture.jpg"), 0, 0, getWidth(), getHeight(), null);
	}

}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Asm.Apolo.Dom.UoW;
using Asm.Dominio.Modulos.Core.Agregados.Mascotas;
using Asm.Infra.Apolo;

namespace Asm.Infra.Modulos.Core.Repositorios
{

    public partial class RepoMascotas : RepositoryIdentity<Mascota>, IRepoMascotas
    {
        public RepoMascotas(IUnitOfWork context) : base(context)
        {
        }
    }
}


text:
package org.apache.spark.examples.h2o

import java.net.URI

import hex.Model.Output
import org.apache.spark.SparkContext
import org.apache.spark.examples.h2o.CraigslistJobTitlesApp.show
import org.apache.spark.h2o._
import org.apache.spark.sql.SQLContext
import org.apache.spark.streaming._
import water.app.{ModelSerializationSupport, SparkContextSupport}

/**
 * Variant of Craigslist App with streaming support to classify
 * incoming events.
 *
 * Launch: nc -lk 9999
 * and send events from your console
 *
 * Send "poison pill" to kill the application.
 *
 */
object CraigslistJobTitlesStreamingApp extends SparkContextSupport with ModelSerializationSupport {

  val POISON_PILL_MSG = "poison pill"

  def main(args: Array[String]) {
    // Prepare environment
    val sc = new SparkContext(configure("CraigslistJobTitlesStreamingApp"))
    val ssc = new StreamingContext(sc, Seconds(10))
    val sqlContext = new SQLContext(sc)
    // Start H2O services
    val h2oContext = H2OContext.getOrCreate(sc)

    // Build an initial model
    val staticApp = new CraigslistJobTitlesApp()(sc, sqlContext, h2oContext)
    try {
      val (svModel, w2vModel) = staticApp.buildModels("examples/smalldata/craigslistJobTitles.csv", "initialModel")
      val modelId = svModel._key.toString
      val classNames = svModel._output.asInstanceOf[Output].classNames()

      // Lets save models
      exportSparkModel(w2vModel, URI.create("file:///tmp/sparkmodel"))
      exportH2OModel(svModel, URI.create("file:///tmp/h2omodel/"))

      // Start streaming context
      val jobTitlesStream = ssc.socketTextStream("localhost", 9999)

      // Classify incoming messages
      jobTitlesStream.filter(!_.isEmpty)
        .map(jobTitle => (jobTitle, staticApp.classify(jobTitle, modelId, w2vModel)))
        .map(pred => "\"" + pred._1 + "\" = " + show(pred._2, classNames))
        .print()

      // Shutdown app if poison pill is passed as a message
      jobTitlesStream.filter(msg => POISON_PILL_MSG == msg)
        .foreachRDD(rdd => if (!rdd.isEmpty()) {
          println("Poison pill received! Application is going to shut down...")
          ssc.stop(true, true)
          staticApp.shutdown()
      })

      println("Please start the event producer at port 9999, for example: nc -lk 9999")
      ssc.start()
      ssc.awaitTermination()

    } catch {
      case e: Throwable => e.printStackTrace()
    } finally {
      ssc.stop()
      staticApp.shutdown()
    }
  }

}


text:
import _ from 'lodash';
import toPath from 'lodash/internal/toPath';

module.exports = function unset(object, rawPath) {
  if (!object) return;
  const path = toPath(rawPath);

  switch (path.length) {
    case 0:
      return;

    case 1:
      delete object[rawPath];
      break;

    default:
      const leaf = path.pop();
      const parentPath = path.slice();
      const parent = _.get(object, parentPath);
      unset(parent, leaf);
      if (!_.size(parent)) {
        unset(object, parentPath);
      }
      break;
  }
};


text:
//[-------------------------------------------------------]
//[ Includes                                              ]
//[-------------------------------------------------------]
#include "Renderer/Public/Resource/CompositorNode/Pass/Compute/CompositorInstancePassCompute.h"
#include "Renderer/Public/Resource/CompositorNode/Pass/Compute/CompositorResourcePassCompute.h"
#include "Renderer/Public/Resource/CompositorNode/CompositorNodeInstance.h"
#include "Renderer/Public/Resource/CompositorWorkspace/CompositorWorkspaceInstance.h"
#include "Renderer/Public/Resource/MaterialBlueprint/MaterialBlueprintResourceManager.h"
#include "Renderer/Public/Resource/Material/MaterialResourceManager.h"
#include "Renderer/Public/Resource/Material/MaterialResource.h"
#include "Renderer/Public/Core/IProfiler.h"
#include "Renderer/Public/IRenderer.h"

//[-------------------------------------------------------]
//[ Namespace                                             ]
//[-------------------------------------------------------]
namespace Renderer
{

	//[-------------------------------------------------------]
	//[ Public methods                                        ]
	//[-------------------------------------------------------]
	CompositorInstancePassCompute::CompositorInstancePassCompute(const CompositorResourcePassCompute& compositorResourcePassCompute, const CompositorNodeInstance& compositorNodeInstance) :
		ICompositorInstancePass(compositorResourcePassCompute, compositorNodeInstance),
		mComputeMaterialBlueprint(true),
		mRenderQueue(compositorNodeInstance.getCompositorWorkspaceInstance().getRenderer().getMaterialBlueprintResourceManager().getIndirectBufferManager(), 0, 0, false, false, false),
		mMaterialResourceId(getInvalid<MaterialResourceId>())
	{
		const IRenderer& renderer = compositorNodeInstance.getCompositorWorkspaceInstance().getRenderer();

		// Sanity checks
		RHI_ASSERT(renderer.getContext(), !compositorResourcePassCompute.isMaterialDefinitionMandatory() || isValid(compositorResourcePassCompute.getMaterialAssetId()) || isValid(compositorResourcePassCompute.getMaterialBlueprintAssetId()), "Invalid compositor resource pass compute configuration")
		RHI_ASSERT(renderer.getContext(), !(isValid(compositorResourcePassCompute.getMaterialAssetId()) && isValid(compositorResourcePassCompute.getMaterialBlueprintAssetId())), "Invalid compositor resource pass compute configuration")

		// Get parent material resource ID and initiate creating the compositor instance pass compute material resource
		MaterialResourceManager& materialResourceManager = renderer.getMaterialResourceManager();
		if (isValid(compositorResourcePassCompute.getMaterialAssetId()))
		{
			// Get or load material resource
			MaterialResourceId materialResourceId = getInvalid<MaterialResourceId>();
			materialResourceManager.loadMaterialResourceByAssetId(compositorResourcePassCompute.getMaterialAssetId(), materialResourceId, this);
		}
		else
		{
			// Get or load material blueprint resource
			const AssetId materialBlueprintAssetId = compositorResourcePassCompute.getMaterialBlueprintAssetId();
			if (isValid(materialBlueprintAssetId))
			{
				MaterialResourceId parentMaterialResourceId = materialResourceManager.getMaterialResourceIdByAssetId(materialBlueprintAssetId);
				if (isInvalid(parentMaterialResourceId))
				{
					parentMaterialResourceId = materialResourceManager.createMaterialResourceByAssetId(materialBlueprintAssetId, materialBlueprintAssetId, compositorResourcePassCompute.getMaterialTechniqueId());
				}
				createMaterialResource(parentMaterialResourceId);
			}
		}
	}

	CompositorInstancePassCompute::~CompositorInstancePassCompute()
	{
		if (isValid(mMaterialResourceId))
		{
			// Clear the renderable manager
			mRenderableManager.getRenderables().clear();

			// Destroy the material resource the compositor instance pass compute created
			getCompositorNodeInstance().getCompositorWorkspaceInstance().getRenderer().getMaterialResourceManager().destroyMaterialResource(mMaterialResourceId);
		}
	}

	//[-------------------------------------------------------]
	//[ Public virtual Renderer::ICompositorInstancePass methods ]
	//[-------------------------------------------------------]
	void CompositorInstancePassCompute::onFillCommandBuffer(const Rhi::IRenderTarget* renderTarget, const CompositorContextData& compositorContextData, Rhi::CommandBuffer& commandBuffer)
	{
		if (isValid(mMaterialResourceId))
		{
			// Sanity check
			RHI_ASSERT(getCompositorNodeInstance().getCompositorWorkspaceInstance().getRenderer().getContext(), !mRenderableManager.getRenderables().empty(), "No renderables")

			// Combined scoped profiler CPU and GPU sample as well as renderer debug event command
			RENDERER_SCOPED_PROFILER_EVENT_DYNAMIC(getCompositorNodeInstance().getCompositorWorkspaceInstance().getRenderer().getContext(), commandBuffer, getCompositorResourcePass().getDebugName())

			// Fill command buffer depending on graphics or compute material blueprint
			mRenderQueue.addRenderablesFromRenderableManager(mRenderableManager, static_cast<const CompositorResourcePassCompute&>(getCompositorResourcePass()).getMaterialTechniqueId(), compositorContextData);
			if (mRenderQueue.getNumberOfDrawCalls() > 0)
			{
				if (mComputeMaterialBlueprint)
				{
					// Sanity check
					RHI_ASSERT(getCompositorNodeInstance().getCompositorWorkspaceInstance().getRenderer().getContext(), nullptr == renderTarget, "The compute compositor instance pass needs an invalid render target in case a compute material blueprint is used")

					// Fill command buffer using a compute material blueprint
					mRenderQueue.fillComputeCommandBuffer(compositorContextData, commandBuffer);
				}
				else
				{
					// Sanity check
					RHI_ASSERT(getCompositorNodeInstance().getCompositorWorkspaceInstance().getRenderer().getContext(), nullptr != renderTarget, "The compute compositor instance pass needs a valid render target in case a graphics material blueprint is used")

					// Fill command buffer using a graphics material blueprint
					mRenderQueue.fillGraphicsCommandBuffer(*renderTarget, compositorContextData, commandBuffer);
				}
			}
		}
	}

	//[-------------------------------------------------------]
	//[ Protected virtual Renderer::IResourceListener methods ]
	//[-------------------------------------------------------]
	void CompositorInstancePassCompute::onLoadingStateChange(const IResource& resource)
	{
		RHI_ASSERT(getCompositorNodeInstance().getCompositorWorkspaceInstance().getRenderer().getContext(), resource.getId() == mMaterialResourceId, "Invalid material resource ID")
		createMaterialResource(resource.getId());
	}

	//[-------------------------------------------------------]
	//[ Protected virtual Renderer::CompositorInstancePassCompute methods ]
	//[-------------------------------------------------------]
	void CompositorInstancePassCompute::createMaterialResource(MaterialResourceId parentMaterialResourceId)
	{
		const IRenderer& renderer = getCompositorNodeInstance().getCompositorWorkspaceInstance().getRenderer();

		// Sanity checks
		RHI_ASSERT(renderer.getContext(), isInvalid(mMaterialResourceId), "Invalid material resource ID")
		RHI_ASSERT(renderer.getContext(), isValid(parentMaterialResourceId), "Invalid material resource ID")

		// Each compositor instance pass compute must have its own material resource since material property values might vary
		MaterialResourceManager& materialResourceManager = renderer.getMaterialResourceManager();
		mMaterialResourceId = materialResourceManager.createMaterialResourceByCloning(parentMaterialResourceId);

		// Graphics or compute material blueprint?
		mComputeMaterialBlueprint = true;
		MaterialResource& materialResource = materialResourceManager.getById(mMaterialResourceId);
		{
			const MaterialTechnique* materialTechnique = materialResource.getMaterialTechniqueById(MaterialResourceManager::DEFAULT_MATERIAL_TECHNIQUE_ID);
			RHI_ASSERT(renderer.getContext(), nullptr != materialTechnique, "Invalid material technique")
			MaterialBlueprintResource* materialBlueprintResource = renderer.getMaterialBlueprintResourceManager().tryGetById(materialTechnique->getMaterialBlueprintResourceId());
			RHI_ASSERT(renderer.getContext(), nullptr != materialBlueprintResource, "Invalid material blueprint resource")
			mComputeMaterialBlueprint = isValid(materialBlueprintResource->getComputeShaderBlueprintResourceId());
		}

		{ // Set compositor resource pass compute material properties
			const MaterialProperties::SortedPropertyVector& sortedPropertyVector = static_cast<const CompositorResourcePassCompute&>(getCompositorResourcePass()).getMaterialProperties().getSortedPropertyVector();
			if (!sortedPropertyVector.empty())
			{
				for (const MaterialProperty& materialProperty : sortedPropertyVector)
				{
					if (materialProperty.isOverwritten())
					{
						materialResource.setPropertyById(materialProperty.getMaterialPropertyId(), materialProperty);
					}
				}
			}
		}

		// Setup renderable manager using attribute-less rendering
		#ifdef RHI_DEBUG
			mRenderableManager.setDebugName(materialResource.getDebugName());
		#endif
		mRenderableManager.getRenderables().emplace_back(mRenderableManager, Rhi::IVertexArrayPtr(), materialResourceManager, mMaterialResourceId, getInvalid<SkeletonResourceId>(), false, 0, 3, 1 RHI_RESOURCE_DEBUG_NAME(materialResource.getDebugName()));
	}

//[-------------------------------------------------------]
//[ Namespace                                             ]
//[-------------------------------------------------------]
} // Renderer


text:
Meteor.absoluteUrl = function (path, options) {
  // path is optional
  if (!options && typeof path === 'object') {
    options = path;
    path = undefined;
  }
  // merge options with defaults
  options = _.extend({}, Meteor.absoluteUrl.defaultOptions, options || {});

  var url = options.rootUrl;
  if (!url)
    throw new Error("Must pass options.rootUrl or set ROOT_URL in the server environment");

  if (!/^http[s]?:\/\//i.test(url)) // url starts with 'http://' or 'https://'
    url = 'http://' + url; // we will later fix to https if options.secure is set

  if (!/\/$/.test(url)) // url ends with '/'
    url += '/';

  if (path)
    url += path;

  // turn http to http if secure option is set, and we're not talking
  // to localhost.
  if (options.secure &&
      /^http:/.test(url) && // url starts with 'http:'
      !/http:\/\/localhost[:\/]/.test(url) && // doesn't match localhost
      !/http:\/\/127\.0\.0\.1[:\/]/.test(url)) // or 127.0.0.1
    url = url.replace(/^http:/, 'https:');

  if (options.replaceLocalhost)
    url = url.replace(/^http:\/\/localhost([:\/].*)/, 'http://127.0.0.1$1');

  return url;
};

// allow later packages to override default options
Meteor.absoluteUrl.defaultOptions = { };
if (typeof __meteor_runtime_config__ === "object" &&
    __meteor_runtime_config__.ROOT_URL)
  Meteor.absoluteUrl.defaultOptions.rootUrl = __meteor_runtime_config__.ROOT_URL;

Meteor._relativeToSiteRootUrl = function (link) {
  if (typeof __meteor_runtime_config__ === "object" &&
      link.substr(0, 1) === "/")
    link = (__meteor_runtime_config__.ROOT_URL_PATH_PREFIX || "") + link;
  return link;
};


text:
<?php

namespace Module\Classes\Actions;

class Middleware extends Action
{
    protected $file ='middleware';
    // add middleware to middleware.php in cache
    public function add()
    {
        if($moduleMiddleware = $this->module->middleware())
        {
            $middleware = $this->load();
            $middleware = array_merge($middleware,$moduleMiddleware);
            return $this->set($middleware);
        }
        return true;
    }
    // remove middleware to middleware.php in cache
    public function remove()
    {
        if($moduleMiddleware = $this->module->middleware())
        {
            $middleware = $this->load();
            $middleware = array_diff($middleware,$moduleMiddleware);
            return $this->set($middleware);
        }
        return true;
    }
}