Module Expr Str Assign NameStore ListLoad Str Str Str Str Str Str Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad Str attr Call NameLoad BinOpAdd BinOpAdd BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Assign NameStore Num Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults NameLoad NameLoad body Expr Str Global identifier Global identifier Global identifier Global identifier Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore BinOpMult SubscriptLoad NameLoad Index Num NameLoad Assign NameStore ListLoad Num For NameStore Call NameLoad Num NameLoad body Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpMult SubscriptLoad NameLoad Index BinOpSub NameLoad Num Call NameLoad NameLoad Num Delete NameDel decorator_list Expr Call NameLoad FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore SubscriptLoad NameLoad Index BinOpSub NameLoad Num If CompareEq NameLoad Num body Return Str AugAssignSub NameStore Num Return BinOpAdd SubscriptLoad NameLoad Index BinOpDiv NameLoad NameLoad Call NameLoad BinOpMod NameLoad NameLoad BinOpSub NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Num For TupleStore NameStore NameStore Call NameLoad NameLoad body AugAssignAdd NameStore BinOpAdd BinOpMult SubscriptLoad NameLoad Index BinOpSub BinOpSub NameLoad NameLoad Num Call AttributeLoad NameLoad attr NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If NameLoad body Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad orelse Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore NameLoad If CompareIs NameLoad NameLoad body Assign NameStore NameLoad If CompareGt NameLoad NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Return ListLoad NameLoad Assign NameStore BinOpFloorDiv BinOpAdd Call NameLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Num Return ListLoad Call NameLoad AttributeLoad NameLoad attr Call NameLoad NameLoad keyword AttributeLoad NameLoad attr Call NameLoad Call NameLoad BinOpAdd NameLoad Num AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return BoolOpAnd CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body If CompareIs AttributeLoad NameLoad attr NameLoad body Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad BinOpAdd Call NameLoad NameLoad Num Return Call NameLoad NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict Assign SubscriptStore NameLoad Index Str Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr Str keyword NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr Num If UnaryOpNot NameLoad body Return NameLoad Assign NameStore BoolOpOr Call AttributeLoad SubscriptLoad NameLoad Index Num attr Str Return Call NameLoad NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore NameLoad Index Str AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call NameLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str keyword Call AttributeLoad NameLoad attr Str decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults AttributeLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Num Call AttributeLoad NameLoad attr NameLoad attr NameLoad body Expr Str If CompareLt NameLoad Num body Raise Call NameLoad Str Assign NameStore Call NameLoad keyword NameLoad If Call NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body If NameLoad body Return ListLoad Call NameLoad keyword NameLoad orelse Return ListLoad Assign NameStore ListLoad NameLoad Assign NameStore ListLoad While BoolOpAnd NameLoad CompareLt BinOpAdd Call NameLoad NameLoad Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Num If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad orelse Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr If Call NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad BinOpAdd NameLoad NameLoad keyword Lambda arguments args NameParam defaults AttributeLoad NameLoad attr If NameLoad body If UnaryOpNot NameLoad body Return ListLoad Call NameLoad keyword NameLoad Assign NameStore ListLoad For NameStore Call NameLoad Call NameLoad NameLoad body If CompareEq NameLoad Num body Assign NameStore NameLoad orelse Assign NameStore AttributeLoad SubscriptLoad NameLoad Index NameLoad attr If CompareEq NameLoad BinOpSub Call NameLoad NameLoad Num body Assign NameStore NameLoad orelse Assign NameStore Call NameLoad BinOpSub Call NameLoad AttributeLoad SubscriptLoad NameLoad Index BinOpAdd NameLoad Num attr Num Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad keyword NameLoad Return NameLoad orelse Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr For NameStore Call AttributeLoad NameLoad attr body Expr Yield BoolOpOr Call AttributeLoad NameLoad attr Str decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str keyword NameLoad keyword NameLoad Return Call AttributeLoad NameLoad attr keyword NameLoad decorator_list
N/A N/A Represents a lexographic range of namespaces. N/A __all__ N/A NAMESPACE_CHARACTERS MAX_NAMESPACE_LENGTH MAX_NAMESPACE MIN_NAMESPACE NamespaceRange get_namespace_keys N/A itertools N/A string google.appengine.api datastore google.appengine.ext db google.appengine.ext.db metadata N/A NAMESPACE_CHARACTERS N/A N/A join N/A sorted N/A N/A N/A N/A string digits N/A string lowercase N/A string uppercase ._- N/A MAX_NAMESPACE_LENGTH 100 N/A MIN_NAMESPACE _setup_constants N/A N/A alphabet max_length N/A NAMESPACE_CHARACTERS MAX_NAMESPACE_LENGTH N/A N/A Calculate derived constant values. Only useful for testing. N/A NAMESPACE_CHARACTERS N/A MAX_NAMESPACE_LENGTH N/A MAX_NAMESPACE N/A _LEX_DISTANCE N/A NAMESPACE_CHARACTERS alphabet N/A MAX_NAMESPACE_LENGTH max_length N/A MAX_NAMESPACE N/A N/A NAMESPACE_CHARACTERS N/A -1 MAX_NAMESPACE_LENGTH N/A _LEX_DISTANCE N/A 1 N/A i N/A range 1 MAX_NAMESPACE_LENGTH N/A N/A N/A N/A _LEX_DISTANCE append N/A N/A N/A _LEX_DISTANCE N/A N/A i 1 N/A len NAMESPACE_CHARACTERS 1 N/A i N/A N/A N/A _setup_constants _ord_to_namespace N/A N/A n _max_length N/A None N/A N/A Convert a namespace ordinal to a namespace string.

  Converts an int, representing the sequence number of a namespace ordered
  lexographically, into a namespace string.

  >>> _ord_to_namespace(0)
  ''
  >>> _ord_to_namespace(1)
  '-'
  >>> _ord_to_namespace(2)
  '--'
  >>> _ord_to_namespace(3)
  '---'

  Args:
    n: A number representing the lexographical ordering of a namespace.

  Returns:
    A string representing the nth namespace in lexographical order.
   N/A N/A _max_length None N/A N/A _max_length MAX_NAMESPACE_LENGTH N/A length N/A _LEX_DISTANCE N/A N/A _max_length 1 N/A N/A n 0 N/A N/A N/A n 1 N/A N/A N/A NAMESPACE_CHARACTERS N/A N/A n length N/A _ord_to_namespace N/A n length N/A _max_length 1 N/A _namespace_to_ord N/A N/A namespace N/A N/A N/A Converts a namespace string into an int representing its lexographic order.

  >>> _namespace_to_ord('')
  ''
  >>> _namespace_to_ord('_')
  1
  >>> _namespace_to_ord('__')
  2

  Args:
    namespace: A namespace string.

  Returns:
    An int representing the lexographical order of the given namespace string.
   N/A n 0 N/A N/A i c N/A enumerate namespace N/A N/A n N/A N/A N/A _LEX_DISTANCE N/A N/A N/A MAX_NAMESPACE_LENGTH i 1 N/A N/A NAMESPACE_CHARACTERS index c 1 N/A n N/A _key_for_namespace N/A N/A namespace app N/A N/A N/A Return the __namespace__ key for a namespace.

  Args:
    namespace: The namespace whose key is requested.
    app: The id of the application that the key belongs to.

  Returns:
    A db.Key representing the namespace.
   N/A namespace N/A N/A N/A N/A N/A db Key from_path N/A N/A metadata Namespace KIND_NAME namespace _app app N/A N/A N/A N/A N/A db Key from_path N/A N/A metadata Namespace KIND_NAME N/A N/A metadata Namespace EMPTY_NAMESPACE_ID _app app N/A NamespaceRange N/A object N/A N/A An inclusive lexographical range of namespaces.

  This class is immutable.
   __init__ N/A N/A self namespace_start namespace_end _app N/A None None None N/A N/A Initializes a NamespaceRange instance.

    Args:
      namespace_start: A string representing the start of the namespace range.
          namespace_start is included in the range. If namespace_start is None
          then the lexographically first namespace is used.
      namespace_end: A string representing the end of the namespace range.
          namespace_end is included in the range and must be >= namespace_start.
          If namespace_end is None then the lexographically last namespace is
          used.

    Raises:
      ValueError: if namespace_start > namespace_end.
     N/A N/A namespace_start None N/A N/A namespace_start MIN_NAMESPACE N/A N/A namespace_end None N/A N/A namespace_end MAX_NAMESPACE N/A N/A namespace_start namespace_end N/A N/A N/A ValueError N/A namespace_start (%r) > namespace_end (%r) N/A namespace_start namespace_end N/A N/A self __namespace_start namespace_start N/A N/A self __namespace_end namespace_end N/A N/A self __app _app N/A app N/A N/A self N/A N/A N/A N/A self __app N/A property namespace_start N/A N/A self N/A N/A N/A N/A self __namespace_start N/A property namespace_end N/A N/A self N/A N/A N/A N/A self __namespace_end N/A property is_single_namespace N/A N/A self N/A N/A N/A True if the namespace range only includes a single namespace. N/A N/A N/A self namespace_start N/A self namespace_end N/A property split_range N/A N/A self N/A N/A N/A Splits the NamespaceRange into two nearly equal-sized ranges.

    Returns:
      If this NamespaceRange contains a single namespace then a list containing
      this NamespaceRange is returned. Otherwise a two-element list containing
      two NamespaceRanges whose total range is identical to this
      NamespaceRange's is returned.
     N/A N/A self is_single_namespace N/A N/A N/A self N/A mid_point N/A N/A N/A _namespace_to_ord N/A self namespace_start N/A _namespace_to_ord N/A self namespace_end 2 N/A N/A N/A NamespaceRange N/A self namespace_start N/A _ord_to_namespace mid_point _app N/A self app N/A NamespaceRange N/A _ord_to_namespace N/A mid_point 1 N/A self namespace_end _app N/A self app N/A __copy__ N/A N/A self N/A N/A N/A N/A N/A self __class__ N/A self __namespace_start N/A self __namespace_end N/A self __app N/A __eq__ N/A N/A self o N/A N/A N/A N/A N/A N/A self namespace_start N/A o namespace_start N/A N/A self namespace_end N/A o namespace_end N/A __hash__ N/A N/A self N/A N/A N/A N/A hash N/A N/A self namespace_start N/A self namespace_end N/A self app N/A __repr__ N/A N/A self N/A N/A N/A N/A N/A self app None N/A N/A N/A NamespaceRange(namespace_start=%r, namespace_end=%r) N/A N/A self namespace_start N/A self namespace_end N/A N/A N/A NamespaceRange(namespace_start=%r, namespace_end=%r, _app=%r) N/A N/A self namespace_start N/A self namespace_end N/A self app N/A with_start_after N/A N/A self after_namespace N/A N/A N/A Returns a copy of this NamespaceName with a new namespace_start.

    Args:
      after_namespace: A namespace string.

    Returns:
      A NamespaceRange object whose namespace_start is the lexographically next
      namespace after the given namespace string.

    Raises:
      ValueError: if the NamespaceRange includes only a single namespace.
     N/A namespace_start N/A _ord_to_namespace N/A N/A _namespace_to_ord after_namespace 1 N/A N/A NamespaceRange namespace_start N/A self namespace_end _app N/A self app N/A make_datastore_query N/A N/A self N/A N/A N/A Returns a datastore.Query that generates all namespaces in the range.

    Returns:
      A datastore.Query instance that generates db.Keys for each namespace in
      the NamespaceRange.
     N/A filters N/A N/A N/A filters N/A __key__ >=  N/A _key_for_namespace N/A self namespace_start N/A self app N/A N/A filters N/A __key__ <=  N/A _key_for_namespace N/A self namespace_end N/A self app N/A N/A N/A datastore Query __namespace__ filters filters keys_only True _app N/A self app N/A normalized_start N/A N/A self N/A N/A N/A Returns a NamespaceRange with leading non-existant namespaces removed.

    Returns:
      A copy of this NamespaceRange whose namespace_start is adjusted to exlcude
      the portion of the range that contains no actual namespaces in the
      datastore. None is returned if the NamespaceRange contains no actual
      namespaces in the datastore.
     N/A namespaces_after_key N/A N/A N/A N/A self make_datastore_query Get 1 N/A N/A namespaces_after_key N/A N/A None N/A namespace_after_key N/A N/A N/A N/A namespaces_after_key N/A 0 name N/A N/A NamespaceRange namespace_after_key N/A self namespace_end _app N/A self app N/A to_json_object N/A N/A self N/A N/A N/A Returns a dict representation that can be serialized to JSON. N/A obj_dict N/A dict namespace_start N/A self namespace_start namespace_end N/A self namespace_end N/A N/A N/A self app None N/A N/A N/A obj_dict N/A app N/A self app N/A obj_dict N/A from_json_object N/A N/A cls json N/A N/A N/A Returns a NamespaceRange from an object deserialized from JSON. N/A N/A cls N/A json N/A namespace_start N/A json N/A namespace_end _app N/A N/A json get app N/A classmethod split N/A N/A cls n contiguous can_query _app N/A N/A N/A N/A itertools chain N/A N/A itertools repeat True 50 N/A N/A itertools repeat False next None N/A N/A Splits the complete NamespaceRange into n equally-sized NamespaceRanges.

    Args:
      n: The maximum number of NamespaceRanges to return. Fewer than n
          namespaces may be returned.
      contiguous: If True then the returned NamespaceRanges will cover the
          entire space of possible namespaces (i.e. from MIN_NAMESPACE to
          MAX_NAMESPACE) without gaps. If False then the returned
          NamespaceRanges may exclude namespaces that don't appear in the
          datastore.
      can_query: A function that returns True if split() can query the datastore
          to generate more fair namespace range splits, and False otherwise.
          If not set then split() is allowed to make 50 datastore queries.

    Returns:
      A list of at most n NamespaceRanges representing a near-equal distribution
      of actual existant datastore namespaces. The returned list will be sorted
      lexographically.

    Raises:
      ValueError: if n is < 1.
     N/A N/A n 1 N/A N/A N/A ValueError n must be >= 1 N/A ns_range N/A NamespaceRange _app _app N/A N/A can_query N/A N/A ns_range N/A N/A ns_range normalized_start N/A N/A ns_range None N/A N/A contiguous N/A N/A N/A N/A NamespaceRange _app _app N/A N/A N/A N/A ranges N/A ns_range N/A singles N/A N/A N/A ranges N/A N/A N/A len ranges N/A len singles n N/A N/A namespace_range N/A N/A ranges pop 0 N/A N/A namespace_range is_single_namespace N/A N/A N/A N/A singles append namespace_range N/A N/A N/A left right N/A N/A namespace_range split_range N/A N/A can_query N/A N/A right N/A N/A right normalized_start N/A N/A right None N/A N/A N/A N/A ranges append right N/A N/A N/A ranges append left N/A ns_ranges N/A sorted N/A singles ranges key N/A N/A N/A ns_range N/A N/A ns_range namespace_start N/A contiguous N/A N/A N/A ns_ranges N/A N/A N/A N/A NamespaceRange _app _app N/A continuous_ns_ranges N/A N/A i N/A range N/A len ns_ranges N/A N/A N/A i 0 N/A N/A namespace_start MIN_NAMESPACE N/A N/A namespace_start N/A N/A ns_ranges N/A i namespace_start N/A N/A i N/A N/A len ns_ranges 1 N/A N/A namespace_end MAX_NAMESPACE N/A N/A namespace_end N/A _ord_to_namespace N/A N/A _namespace_to_ord N/A N/A ns_ranges N/A N/A i 1 namespace_start 1 N/A N/A N/A continuous_ns_ranges append N/A NamespaceRange namespace_start namespace_end _app _app N/A continuous_ns_ranges N/A N/A ns_ranges N/A classmethod __iter__ N/A N/A self N/A N/A N/A Iterate over all the namespaces within this range. N/A query N/A N/A self make_datastore_query N/A ns_key N/A N/A query Run N/A N/A N/A N/A N/A N/A ns_key name N/A N/A get_namespace_keys N/A N/A app limit N/A N/A N/A Get namespace keys. N/A ns_query N/A N/A datastore Query __namespace__ keys_only True _app app N/A N/A N/A ns_query Get limit limit N/A