<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import base64 <EOL> import os <EOL> from . google_imports import datastore_errors <EOL> from . google_imports import datastore_types <EOL> from . google_imports import namespace_manager <EOL> from . google_imports import entity_pb <EOL> from . import utils <EOL> __all__ = [ '<STR_LIT>' ] <EOL> _MAX_LONG = <NUM_LIT:2> L ** <NUM_LIT> <EOL> _MAX_KEYPART_BYTES = <NUM_LIT> <EOL> class Key ( object ) : <EOL> """<STR_LIT>""" <EOL> __slots__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> def __new__ ( cls , * _args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if _args : <EOL> if len ( _args ) == <NUM_LIT:1> and isinstance ( _args [ <NUM_LIT:0> ] , dict ) : <EOL> if kwargs : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> kwargs = _args [ <NUM_LIT:0> ] <EOL> else : <EOL> if '<STR_LIT>' in kwargs : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> kwargs [ '<STR_LIT>' ] = _args <EOL> self = super ( Key , cls ) . __new__ ( cls ) <EOL> if '<STR_LIT>' in kwargs or '<STR_LIT>' in kwargs or '<STR_LIT>' in kwargs : <EOL> ( self . __reference , <EOL> self . __pairs , <EOL> self . __app , <EOL> self . __namespace ) = self . _parse_from_ref ( cls , ** kwargs ) <EOL> elif '<STR_LIT>' in kwargs or '<STR_LIT>' in kwargs : <EOL> self . __reference = None <EOL> ( self . __pairs , <EOL> self . __app , <EOL> self . __namespace ) = self . _parse_from_args ( ** kwargs ) <EOL> else : <EOL> raise TypeError ( '<STR_LIT>' ) <EOL> return self <EOL> @ staticmethod <EOL> def _parse_from_args ( pairs = None , flat = None , app = None , namespace = None , <EOL> parent = None ) : <EOL> if flat : <EOL> if pairs is not None : <EOL> raise TypeError ( '<STR_LIT>' ) <EOL> if len ( flat ) % <NUM_LIT:2> : <EOL> raise ValueError ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> pairs = [ ( flat [ i ] , flat [ i + <NUM_LIT:1> ] ) for i in xrange ( <NUM_LIT:0> , len ( flat ) , <NUM_LIT:2> ) ] <EOL> else : <EOL> pairs = list ( pairs ) <EOL> if not pairs : <EOL> raise TypeError ( '<STR_LIT>' ) <EOL> for i , ( kind , id ) in enumerate ( pairs ) : <EOL> if isinstance ( id , unicode ) : <EOL> id = id . encode ( '<STR_LIT:utf8>' ) <EOL> elif id is None : <EOL> if i + <NUM_LIT:1> < len ( pairs ) : <EOL> raise datastore_errors . BadArgumentError ( <EOL> '<STR_LIT>' ) <EOL> else : <EOL> if not isinstance ( id , ( int , long , str ) ) : <EOL> raise TypeError ( '<STR_LIT>' % <EOL> id ) <EOL> if isinstance ( kind , type ) : <EOL> kind = kind . _get_kind ( ) <EOL> if isinstance ( kind , unicode ) : <EOL> kind = kind . encode ( '<STR_LIT:utf8>' ) <EOL> if not isinstance ( kind , str ) : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' % kind ) <EOL> if not id : <EOL> id = None <EOL> pairs [ i ] = ( kind , id ) <EOL> if parent is not None : <EOL> if not isinstance ( parent , Key ) : <EOL> raise datastore_errors . BadValueError ( <EOL> '<STR_LIT>' % parent ) <EOL> if not parent . id ( ) : <EOL> raise datastore_errors . BadArgumentError ( <EOL> '<STR_LIT>' ) <EOL> pairs [ : <NUM_LIT:0> ] = parent . pairs ( ) <EOL> if app : <EOL> if app != parent . app ( ) : <EOL> raise ValueError ( '<STR_LIT>' <EOL> '<STR_LIT>' % <EOL> ( app , parent . app ( ) ) ) <EOL> else : <EOL> app = parent . app ( ) <EOL> if namespace is not None : <EOL> if namespace != parent . namespace ( ) : <EOL> raise ValueError ( '<STR_LIT>' <EOL> '<STR_LIT>' % <EOL> ( namespace , parent . namespace ( ) ) ) <EOL> else : <EOL> namespace = parent . namespace ( ) <EOL> if not app : <EOL> app = _DefaultAppId ( ) <EOL> if namespace is None : <EOL> namespace = _DefaultNamespace ( ) <EOL> return tuple ( pairs ) , app , namespace <EOL> @ staticmethod <EOL> def _parse_from_ref ( cls , pairs = None , flat = None , <EOL> reference = None , serialized = None , urlsafe = None , <EOL> app = None , namespace = None , parent = None ) : <EOL> """<STR_LIT>""" <EOL> if cls is not Key : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' % cls ) <EOL> if ( bool ( pairs ) + bool ( flat ) + bool ( reference ) + bool ( serialized ) + <EOL> bool ( urlsafe ) + bool ( parent ) ) != <NUM_LIT:1> : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> if urlsafe : <EOL> serialized = _DecodeUrlSafe ( urlsafe ) <EOL> if serialized : <EOL> reference = _ReferenceFromSerialized ( serialized ) <EOL> if reference : <EOL> reference = _ReferenceFromReference ( reference ) <EOL> pairs = [ ] <EOL> elem = None <EOL> path = reference . path ( ) <EOL> for elem in path . element_list ( ) : <EOL> kind = elem . type ( ) <EOL> if elem . has_id ( ) : <EOL> id_or_name = elem . id ( ) <EOL> else : <EOL> id_or_name = elem . name ( ) <EOL> if not id_or_name : <EOL> id_or_name = None <EOL> tup = ( kind , id_or_name ) <EOL> pairs . append ( tup ) <EOL> if elem is None : <EOL> raise RuntimeError ( '<STR_LIT>' <EOL> % ( urlsafe , serialized , str ( reference ) ) ) <EOL> ref_app = reference . app ( ) <EOL> if app is not None : <EOL> if app != ref_app : <EOL> raise RuntimeError ( '<STR_LIT>' <EOL> '<STR_LIT>' % <EOL> ( ref_app , app ) ) <EOL> ref_namespace = reference . name_space ( ) <EOL> if namespace is not None : <EOL> if namespace != ref_namespace : <EOL> raise RuntimeError ( '<STR_LIT>' <EOL> '<STR_LIT>' % <EOL> ( ref_namespace , namespace ) ) <EOL> return ( reference , tuple ( pairs ) , ref_app , ref_namespace ) <EOL> def __repr__ ( self ) : <EOL> """<STR_LIT>""" <EOL> args = [ ] <EOL> for item in self . flat ( ) : <EOL> if not item : <EOL> args . append ( '<STR_LIT:None>' ) <EOL> elif isinstance ( item , basestring ) : <EOL> if not isinstance ( item , str ) : <EOL> raise TypeError ( '<STR_LIT>' % item ) <EOL> args . append ( repr ( item ) ) <EOL> else : <EOL> args . append ( str ( item ) ) <EOL> if self . app ( ) != _DefaultAppId ( ) : <EOL> args . append ( '<STR_LIT>' % self . app ( ) ) <EOL> if self . namespace ( ) != _DefaultNamespace ( ) : <EOL> args . append ( '<STR_LIT>' % self . namespace ( ) ) <EOL> return '<STR_LIT>' % '<STR_LIT:U+002CU+0020>' . join ( args ) <EOL> __str__ = __repr__ <EOL> def __hash__ ( self ) : <EOL> """<STR_LIT>""" <EOL> return hash ( tuple ( self . pairs ( ) ) ) <EOL> def __eq__ ( self , other ) : <EOL> """<STR_LIT>""" <EOL> if not isinstance ( other , Key ) : <EOL> return NotImplemented <EOL> return ( self . __pairs == other . __pairs and <EOL> self . __app == other . __app and <EOL> self . __namespace == other . __namespace ) <EOL> def __ne__ ( self , other ) : <EOL> """<STR_LIT>""" <EOL> if not isinstance ( other , Key ) : <EOL> return NotImplemented <EOL> return not self . __eq__ ( other ) <EOL> def __tuple ( self ) : <EOL> """<STR_LIT>""" <EOL> return ( self . __app , self . __namespace , self . __pairs ) <EOL> def __lt__ ( self , other ) : <EOL> """<STR_LIT>""" <EOL> if not isinstance ( other , Key ) : <EOL> return NotImplemented <EOL> return self . __tuple ( ) < other . __tuple ( ) <EOL> def __le__ ( self , other ) : <EOL> """<STR_LIT>""" <EOL> if not isinstance ( other , Key ) : <EOL> return NotImplemented <EOL> return self . __tuple ( ) <= other . __tuple ( ) <EOL> def __gt__ ( self , other ) : <EOL> """<STR_LIT>""" <EOL> if not isinstance ( other , Key ) : <EOL> return NotImplemented <EOL> return self . __tuple ( ) > other . __tuple ( ) <EOL> def __ge__ ( self , other ) : <EOL> """<STR_LIT>""" <EOL> if not isinstance ( other , Key ) : <EOL> return NotImplemented <EOL> return self . __tuple ( ) >= other . __tuple ( ) <EOL> def __getstate__ ( self ) : <EOL> """<STR_LIT>""" <EOL> return ( { '<STR_LIT>' : self . __pairs , <EOL> '<STR_LIT>' : self . __app , <EOL> '<STR_LIT>' : self . __namespace } , ) <EOL> def __setstate__ ( self , state ) : <EOL> """<STR_LIT>""" <EOL> if len ( state ) != <NUM_LIT:1> : <EOL> raise TypeError ( '<STR_LIT>' % <EOL> len ( state ) ) <EOL> kwargs = state [ <NUM_LIT:0> ] <EOL> if not isinstance ( kwargs , dict ) : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' % kwargs ) <EOL> self . __reference = None <EOL> self . __pairs = tuple ( kwargs [ '<STR_LIT>' ] ) <EOL> self . __app = kwargs [ '<STR_LIT>' ] <EOL> self . __namespace = kwargs [ '<STR_LIT>' ] <EOL> def __getnewargs__ ( self ) : <EOL> """<STR_LIT>""" <EOL> return ( { '<STR_LIT>' : self . __pairs , <EOL> '<STR_LIT>' : self . __app , <EOL> '<STR_LIT>' : self . __namespace } , ) <EOL> def parent ( self ) : <EOL> """<STR_LIT>""" <EOL> pairs = self . __pairs <EOL> if len ( pairs ) <= <NUM_LIT:1> : <EOL> return None <EOL> return Key ( pairs = pairs [ : - <NUM_LIT:1> ] , app = self . __app , namespace = self . __namespace ) <EOL> def root ( self ) : <EOL> """<STR_LIT>""" <EOL> pairs = self . __pairs <EOL> if len ( pairs ) <= <NUM_LIT:1> : <EOL> return self <EOL> return Key ( pairs = pairs [ : <NUM_LIT:1> ] , app = self . __app , namespace = self . __namespace ) <EOL> def namespace ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . __namespace <EOL> def app ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . __app <EOL> def id ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . __pairs [ - <NUM_LIT:1> ] [ <NUM_LIT:1> ] <EOL> def string_id ( self ) : <EOL> """<STR_LIT>""" <EOL> id = self . id ( ) <EOL> if not isinstance ( id , basestring ) : <EOL> id = None <EOL> return id <EOL> def integer_id ( self ) : <EOL> """<STR_LIT>""" <EOL> id = self . id ( ) <EOL> if not isinstance ( id , ( int , long ) ) : <EOL> id = None <EOL> return id <EOL> def pairs ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . __pairs <EOL> def flat ( self ) : <EOL> """<STR_LIT>""" <EOL> flat = [ ] <EOL> for kind , id in self . __pairs : <EOL> flat . append ( kind ) <EOL> flat . append ( id ) <EOL> return tuple ( flat ) <EOL> def kind ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . __pairs [ - <NUM_LIT:1> ] [ <NUM_LIT:0> ] <EOL> def reference ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . __reference is None : <EOL> self . __reference = _ConstructReference ( self . __class__ , <EOL> pairs = self . __pairs , <EOL> app = self . __app , <EOL> namespace = self . __namespace ) <EOL> return self . __reference <EOL> def serialized ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . reference ( ) . Encode ( ) <EOL> def urlsafe ( self ) : <EOL> """<STR_LIT>""" <EOL> urlsafe = base64 . b64encode ( self . reference ( ) . Encode ( ) ) <EOL> return urlsafe . rstrip ( '<STR_LIT:=>' ) . replace ( '<STR_LIT:+>' , '<STR_LIT:->' ) . replace ( '<STR_LIT:/>' , '<STR_LIT:_>' ) <EOL> def get ( self , ** ctx_options ) : <EOL> """<STR_LIT>""" <EOL> return self . get_async ( ** ctx_options ) . get_result ( ) <EOL> def get_async ( self , ** ctx_options ) : <EOL> """<STR_LIT>""" <EOL> from . import model , tasklets <EOL> ctx = tasklets . get_context ( ) <EOL> cls = model . Model . _kind_map . get ( self . kind ( ) ) <EOL> if cls : <EOL> cls . _pre_get_hook ( self ) <EOL> fut = ctx . get ( self , ** ctx_options ) <EOL> if cls : <EOL> post_hook = cls . _post_get_hook <EOL> if not cls . _is_default_hook ( model . Model . _default_post_get_hook , <EOL> post_hook ) : <EOL> fut . add_immediate_callback ( post_hook , self , fut ) <EOL> return fut <EOL> def delete ( self , ** ctx_options ) : <EOL> """<STR_LIT>""" <EOL> return self . delete_async ( ** ctx_options ) . get_result ( ) <EOL> def delete_async ( self , ** ctx_options ) : <EOL> """<STR_LIT>""" <EOL> from . import tasklets , model <EOL> ctx = tasklets . get_context ( ) <EOL> cls = model . Model . _kind_map . get ( self . kind ( ) ) <EOL> if cls : <EOL> cls . _pre_delete_hook ( self ) <EOL> fut = ctx . delete ( self , ** ctx_options ) <EOL> if cls : <EOL> post_hook = cls . _post_delete_hook <EOL> if not cls . _is_default_hook ( model . Model . _default_post_delete_hook , <EOL> post_hook ) : <EOL> fut . add_immediate_callback ( post_hook , self , fut ) <EOL> return fut <EOL> @ classmethod <EOL> def from_old_key ( cls , old_key ) : <EOL> return cls ( urlsafe = str ( old_key ) ) <EOL> def to_old_key ( self ) : <EOL> return datastore_types . Key ( encoded = self . urlsafe ( ) ) <EOL> @ utils . positional ( <NUM_LIT:1> ) <EOL> def _ConstructReference ( cls , pairs = None , flat = None , <EOL> reference = None , serialized = None , urlsafe = None , <EOL> app = None , namespace = None , parent = None ) : <EOL> """<STR_LIT>""" <EOL> if cls is not Key : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' % cls ) <EOL> if ( bool ( pairs ) + bool ( flat ) + bool ( reference ) + bool ( serialized ) + <EOL> bool ( urlsafe ) ) != <NUM_LIT:1> : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> if flat or pairs : <EOL> if flat : <EOL> if len ( flat ) % <NUM_LIT:2> : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> pairs = [ ( flat [ i ] , flat [ i + <NUM_LIT:1> ] ) for i in xrange ( <NUM_LIT:0> , len ( flat ) , <NUM_LIT:2> ) ] <EOL> elif parent is not None : <EOL> pairs = list ( pairs ) <EOL> if not pairs : <EOL> raise TypeError ( '<STR_LIT>' ) <EOL> if parent is not None : <EOL> if not isinstance ( parent , Key ) : <EOL> raise datastore_errors . BadValueError ( <EOL> '<STR_LIT>' % parent ) <EOL> pairs [ : <NUM_LIT:0> ] = parent . pairs ( ) <EOL> if app : <EOL> if app != parent . app ( ) : <EOL> raise ValueError ( '<STR_LIT>' <EOL> '<STR_LIT>' % <EOL> ( app , parent . app ( ) ) ) <EOL> else : <EOL> app = parent . app ( ) <EOL> if namespace is not None : <EOL> if namespace != parent . namespace ( ) : <EOL> raise ValueError ( '<STR_LIT>' <EOL> '<STR_LIT>' % <EOL> ( namespace , parent . namespace ( ) ) ) <EOL> else : <EOL> namespace = parent . namespace ( ) <EOL> reference = _ReferenceFromPairs ( pairs , app = app , namespace = namespace ) <EOL> else : <EOL> if parent is not None : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> if urlsafe : <EOL> serialized = _DecodeUrlSafe ( urlsafe ) <EOL> if serialized : <EOL> reference = _ReferenceFromSerialized ( serialized ) <EOL> if not reference . path ( ) . element_size ( ) : <EOL> raise RuntimeError ( '<STR_LIT>' <EOL> % ( urlsafe , serialized , str ( reference ) ) ) <EOL> if not serialized : <EOL> reference = _ReferenceFromReference ( reference ) <EOL> if app is not None : <EOL> ref_app = reference . app ( ) <EOL> if app != ref_app : <EOL> raise RuntimeError ( '<STR_LIT>' <EOL> '<STR_LIT>' % <EOL> ( ref_app , app ) ) <EOL> if namespace is not None : <EOL> ref_namespace = reference . name_space ( ) <EOL> if namespace != ref_namespace : <EOL> raise RuntimeError ( '<STR_LIT>' <EOL> '<STR_LIT>' % <EOL> ( ref_namespace , namespace ) ) <EOL> return reference <EOL> def _ReferenceFromPairs ( pairs , reference = None , app = None , namespace = None ) : <EOL> """<STR_LIT>""" <EOL> if reference is None : <EOL> reference = entity_pb . Reference ( ) <EOL> path = reference . mutable_path ( ) <EOL> last = False <EOL> for kind , idorname in pairs : <EOL> if last : <EOL> raise datastore_errors . BadArgumentError ( <EOL> '<STR_LIT>' ) <EOL> t = type ( kind ) <EOL> if t is str : <EOL> pass <EOL> elif t is unicode : <EOL> kind = kind . encode ( '<STR_LIT:utf8>' ) <EOL> else : <EOL> if issubclass ( t , type ) : <EOL> from . model import Model <EOL> modelclass = kind <EOL> if not issubclass ( modelclass , Model ) : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' % modelclass ) <EOL> kind = modelclass . _get_kind ( ) <EOL> t = type ( kind ) <EOL> if t is str : <EOL> pass <EOL> elif t is unicode : <EOL> kind = kind . encode ( '<STR_LIT:utf8>' ) <EOL> elif issubclass ( t , str ) : <EOL> pass <EOL> elif issubclass ( t , unicode ) : <EOL> kind = kind . encode ( '<STR_LIT:utf8>' ) <EOL> else : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' % kind ) <EOL> if not ( <NUM_LIT:1> <= len ( kind ) <= _MAX_KEYPART_BYTES ) : <EOL> raise ValueError ( '<STR_LIT>' <EOL> '<STR_LIT>' % <EOL> ( _MAX_KEYPART_BYTES , kind ) ) <EOL> elem = path . add_element ( ) <EOL> elem . set_type ( kind ) <EOL> t = type ( idorname ) <EOL> if t is int or t is long : <EOL> if not ( <NUM_LIT:1> <= idorname < _MAX_LONG ) : <EOL> raise ValueError ( '<STR_LIT>' % idorname ) <EOL> elem . set_id ( idorname ) <EOL> elif t is str : <EOL> if not ( <NUM_LIT:1> <= len ( idorname ) <= _MAX_KEYPART_BYTES ) : <EOL> raise ValueError ( '<STR_LIT>' <EOL> '<STR_LIT>' % <EOL> ( _MAX_KEYPART_BYTES , idorname ) ) <EOL> elem . set_name ( idorname ) <EOL> elif t is unicode : <EOL> idorname = idorname . encode ( '<STR_LIT:utf8>' ) <EOL> if not ( <NUM_LIT:1> <= len ( idorname ) <= _MAX_KEYPART_BYTES ) : <EOL> raise ValueError ( '<STR_LIT>' <EOL> '<STR_LIT>' % <EOL> ( _MAX_KEYPART_BYTES , idorname ) ) <EOL> elem . set_name ( idorname ) <EOL> elif idorname is None : <EOL> last = True <EOL> elif issubclass ( t , ( int , long ) ) : <EOL> if not ( <NUM_LIT:1> <= idorname < _MAX_LONG ) : <EOL> raise ValueError ( '<STR_LIT>' % idorname ) <EOL> elem . set_id ( idorname ) <EOL> elif issubclass ( t , basestring ) : <EOL> if issubclass ( t , unicode ) : <EOL> idorname = idorname . encode ( '<STR_LIT:utf8>' ) <EOL> if not ( <NUM_LIT:1> <= len ( idorname ) <= _MAX_KEYPART_BYTES ) : <EOL> raise ValueError ( '<STR_LIT>' <EOL> '<STR_LIT>' % ( _MAX_KEYPART_BYTES , idorname ) ) <EOL> elem . set_name ( idorname ) <EOL> else : <EOL> raise TypeError ( '<STR_LIT>' <EOL> '<STR_LIT>' % idorname ) <EOL> if not app : <EOL> app = _DefaultAppId ( ) <EOL> reference . set_app ( app ) <EOL> if namespace is None : <EOL> namespace = _DefaultNamespace ( ) <EOL> if namespace : <EOL> reference . set_name_space ( namespace ) <EOL> return reference <EOL> def _ReferenceFromReference ( reference ) : <EOL> """<STR_LIT>""" <EOL> new_reference = entity_pb . Reference ( ) <EOL> new_reference . CopyFrom ( reference ) <EOL> return new_reference <EOL> def _ReferenceFromSerialized ( serialized ) : <EOL> """<STR_LIT>""" <EOL> if not isinstance ( serialized , basestring ) : <EOL> raise TypeError ( '<STR_LIT>' % serialized ) <EOL> elif isinstance ( serialized , unicode ) : <EOL> serialized = serialized . encode ( '<STR_LIT:utf8>' ) <EOL> return entity_pb . Reference ( serialized ) <EOL> def _DecodeUrlSafe ( urlsafe ) : <EOL> """<STR_LIT>""" <EOL> if not isinstance ( urlsafe , basestring ) : <EOL> raise TypeError ( '<STR_LIT>' % urlsafe ) <EOL> if isinstance ( urlsafe , unicode ) : <EOL> urlsafe = urlsafe . encode ( '<STR_LIT:utf8>' ) <EOL> mod = len ( urlsafe ) % <NUM_LIT:4> <EOL> if mod : <EOL> urlsafe += '<STR_LIT:=>' * ( <NUM_LIT:4> - mod ) <EOL> return base64 . b64decode ( urlsafe . replace ( '<STR_LIT:->' , '<STR_LIT:+>' ) . replace ( '<STR_LIT:_>' , '<STR_LIT:/>' ) ) <EOL> def _DefaultAppId ( ) : <EOL> """<STR_LIT>""" <EOL> return os . getenv ( '<STR_LIT>' , '<STR_LIT:_>' ) <EOL> def _DefaultNamespace ( ) : <EOL> """<STR_LIT>""" <EOL> return namespace_manager . get_namespace ( ) </s>
