def _execute_request(request):
 service = request.service_name()
 method = request.method()
 if request.has_request_id():
  request_id = request.request_id()
 else:
  logging.error('Received a request without request_id: %s', request)
  request_id = None
 service_methods = remote_api_services.SERVICE_PB_MAP.get(service, {})
 (request_class, response_class) = service_methods.get(method, (None, None))
 if (not request_class):
  raise apiproxy_errors.CallNotFoundError(('%s.%s does not exist' % (service, method)))
 request_data = request_class()
 request_data.ParseFromString(request.request())
 response_data = response_class()
 def make_request():
  apiproxy_stub_map.apiproxy.GetStub(service).MakeSyncCall(service, method, request_data, response_data, request_id)
 if (service in THREAD_SAFE_SERVICES):
  make_request()
 else:
  with GLOBAL_API_LOCK:
   make_request()
 return response_data

def _execute_request ( request ) : service = request . service_name ( ) method = request . method ( ) if request . has_request_id ( ) : request_id = request . request_id ( ) else : logging . error ( 'Received a request without request_id: %s' , request ) request_id = None service_methods = remote_api_services . SERVICE_PB_MAP . get ( service , { } ) ( request_class , response_class ) = service_methods . get ( method , ( None , None ) ) if ( not request_class ) : raise apiproxy_errors . CallNotFoundError ( ( '%s.%s does not exist' % ( service , method ) ) ) request_data = request_class ( ) request_data . ParseFromString ( request . request ( ) ) response_data = response_class ( ) def make_request ( ) : apiproxy_stub_map . apiproxy . GetStub ( service ) . MakeSyncCall ( service , method , request_data , response_data , request_id ) if ( service in THREAD_SAFE_SERVICES ) : make_request ( ) else : with GLOBAL_API_LOCK : make_request ( ) return response_data
executes an api method call and returns the response object .