def get_num_instances(server=None, version=None):
 req = servers_service_pb.GetNumInstancesRequest()
 if server:
  req.set_server(server)
 if version:
  req.set_version(version)
 resp = servers_service_pb.GetNumInstancesResponse()
 try:
  apiproxy_stub_map.MakeSyncCall('servers', 'GetNumInstances', req, resp)
 except apiproxy_errors.ApplicationError as e:
  if (e.application_error == servers_service_pb.ServersServiceError.INVALID_VERSION):
   raise InvalidVersionError()
  else:
   raise Error()
 return resp.instances()

def get_num_instances ( server = None , version = None ) : req = servers_service_pb . GetNumInstancesRequest ( ) if server : req . set_server ( server ) if version : req . set_version ( version ) resp = servers_service_pb . GetNumInstancesResponse ( ) try : apiproxy_stub_map . MakeSyncCall ( 'servers' , 'GetNumInstances' , req , resp ) except apiproxy_errors . ApplicationError as e : if ( e . application_error == servers_service_pb . ServersServiceError . INVALID_VERSION ) : raise InvalidVersionError ( ) else : raise Error ( ) return resp . instances ( )
return the number of instances that are set for the given server version .