'Create an RPC object using the configuration parameters.
Internal only.
Args:
config: Optional Configuration object.
service_name: Optional datastore service name.
Returns:
A new UserRPC object with the designated settings.
NOTES:
(1) The RPC object returned can only be used to make a single call
(for details see apiproxy_stub_map.UserRPC).
(2) To make a call, use one of the specific methods on the
Connection object, such as conn.put(entities).  This sends the
call to the server but does not wait.  To wait for the call to
finish and get the result, call rpc.get_result().'

def _create_rpc(self, config=None, service_name=None):

    deadline = Configuration.deadline(config, self.__config)
    on_completion = Configuration.on_completion(config, self.__config)
    callback = None
    if (service_name is None):
        service_name = self._api_version
    if (on_completion is not None):
        def callback():
            return on_completion(rpc)
    rpc = apiproxy_stub_map.UserRPC(service_name, deadline, callback)
    return rpc
