Module Expr Str ImportFrom alias Assign NameStore ListComp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore NameLoad Assign NameStore Call NameLoad ListComp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore NameLoad Assign NameStore Call NameLoad ListComp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareEq BinOpBitAnd NameLoad NameLoad Num body Return NameLoad If CompareLt BinOpBitAnd NameLoad NameLoad NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return ListComp NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad decorator_list Assign NameStore NameLoad FunctionDef arguments args defaults vararg kwarg body Expr Str Return Call NameLoad Lambda arguments args NameParam NameParam defaults BinOpBitOr NameLoad Call AttributeLoad NameLoad attr NameLoad Num NameLoad Call AttributeLoad NameLoad attr Str Num decorator_list
N/A N/A 
Default scope implementation relying on bit shifting. See
:attr:`provider.constants.SCOPES` for the list of available scopes.

Scopes can be combined, such as ``"read write"``. Note that a single
``"write"`` scope is *not* the same as ``"read write"``.

See :class:`provider.scope.to_int` on how scopes are combined.
 constants SCOPES N/A SCOPE_NAMES N/A N/A name name N/A N/A value name SCOPES N/A SCOPE_NAME_DICT N/A dict N/A N/A name value N/A N/A value name SCOPES N/A SCOPE_VALUE_DICT N/A dict N/A N/A value name N/A N/A value name SCOPES check N/A N/A wants has N/A N/A N/A 
    Check if a desired scope ``wants`` is part of an available scope ``has``.

    Returns ``False`` if not, return ``True`` if yes.

    :example:

    If a list of scopes such as

    ::

        READ = 1 << 1
        WRITE = 1 << 2
        READ_WRITE = READ | WRITE

        SCOPES = (
            (READ, 'read'),
            (WRITE, 'write'),
            (READ_WRITE, 'read+write'),
        )

    is defined, we can check if a given scope is part of another:

    ::

        >>> from provider import scope
        >>> scope.check(READ, READ)
        True
        >>> scope.check(WRITE, READ)
        False
        >>> scope.check(WRITE, WRITE)
        True
        >>> scope.check(READ, WRITE)
        False
        >>> scope.check(READ, READ_WRITE)
        True
        >>> scope.check(WRITE, READ_WRITE)
        True

     N/A N/A N/A wants has 0 N/A N/A False N/A N/A N/A wants has wants N/A N/A False N/A True N/A to_names N/A N/A scope N/A N/A N/A 
    Returns a list of scope names as defined in
    :attr:`provider.constants.SCOPES` for a given scope integer.

        >>> assert ['read', 'write'] == provider.scope.names(provider.constants.READ_WRITE)

     N/A N/A name N/A N/A name value N/A N/A SCOPE_NAME_DICT iteritems N/A check value scope N/A N/A names to_names to_int N/A N/A N/A names kwargs N/A N/A 
    Turns a list of scope names into an integer value.

    ::

        >>> scope.to_int('read')
        2
        >>> scope.to_int('write')
        6
        >>> scope.to_int('read', 'write')
        6
        >>> scope.to_int('invalid')
        0
        >>> scope.to_int('invalid', default = 1)
        1

     N/A N/A reduce N/A N/A N/A prev next N/A N/A prev N/A N/A SCOPE_NAME_DICT get next 0 names N/A N/A kwargs pop default 0 N/A