<s> """<STR_LIT>""" <EOL> from google . appengine . api import api_base_pb <EOL> from google . appengine . api import apiproxy_stub_map <EOL> from google . appengine . api import datastore <EOL> from google . appengine . api import datastore_errors <EOL> from google . appengine . api import datastore_types <EOL> from google . appengine . datastore import datastore_index <EOL> from google . appengine . datastore import datastore_pb <EOL> from google . appengine . runtime import apiproxy_errors <EOL> def GetIndices ( _app = None ) : <EOL> """<STR_LIT>""" <EOL> req = api_base_pb . StringProto ( ) <EOL> req . set_value ( datastore_types . ResolveAppId ( _app ) ) <EOL> resp = datastore_pb . CompositeIndices ( ) <EOL> resp = _Call ( '<STR_LIT>' , req , resp ) <EOL> return resp . index_list ( ) <EOL> def CreateIndex ( index ) : <EOL> """<STR_LIT>""" <EOL> resp = api_base_pb . Integer64Proto ( ) <EOL> resp = _Call ( '<STR_LIT>' , index , resp ) <EOL> return resp . value ( ) <EOL> def UpdateIndex ( index ) : <EOL> """<STR_LIT>""" <EOL> _Call ( '<STR_LIT>' , index , api_base_pb . VoidProto ( ) ) <EOL> def DeleteIndex ( index ) : <EOL> """<STR_LIT>""" <EOL> _Call ( '<STR_LIT>' , index , api_base_pb . VoidProto ( ) ) <EOL> def _Call ( call , req , resp ) : <EOL> """<STR_LIT>""" <EOL> if hasattr ( req , '<STR_LIT>' ) : <EOL> req . set_app_id ( datastore_types . ResolveAppId ( req . app_id ( ) ) ) <EOL> try : <EOL> result = apiproxy_stub_map . MakeSyncCall ( '<STR_LIT>' , call , req , resp ) <EOL> if result : <EOL> return result <EOL> return resp <EOL> except apiproxy_errors . ApplicationError , err : <EOL> raise datastore . _ToDatastoreError ( err ) </s>
