class_docstr: Wrapper for remote class in client side.
  1. request cpu resource and submit job to the master
  2. return the result of the function called by the user, using the remote computation resource.
docstr: Args:
      args, kwargs: arguments for the initialization of the unwrapped
      class.
docstr_tok: ["Args",":","args",",","kwargs",":","arguments","for","the","initialization","of","the","unwrapped","class","."]
code: def __init__(self, *args, **kwargs):
      """
      Args:
          args, kwargs: arguments for the initialization of the unwrapped
          class.
      """
      self.GLOBAL_CLIENT = get_global_client()
      self.remote_attribute_keys_set = set()
      self.ctx = self.GLOBAL_CLIENT.ctx
  
      # GLOBAL_CLIENT will set `master_is_alive` to False when hearbeat
      # finds the master is dead.
  
      # class which is decorated by @remote_class
      cls = kwargs.get("_xparl_remote_class")
  
      # max_memory argument in @remote_class decorator
      max_memory = kwargs.get("_xparl_remote_class_max_memory")
      n_gpu = kwargs.get("_xparl_remote_class_n_gpu", 0)
      self.job_is_alive = mp.Value("i", True)
  
      if self.GLOBAL_CLIENT.connected_to_master:
          job_info = self.request_resource(
              self.GLOBAL_CLIENT, max_memory, n_gpu
          )
      else:
          raise Exception(
              "Can not submit job to the master. "
              "Please check if master is still alive."
          )
  
      if job_info is None:
          raise ResourceError(
              "Cannot submit the job to the master. "
              "Please add more computation resources to the "
              "master or try again later."
          )
      job_address = job_info.job_address
  
      self.internal_lock = threading.Lock()
  
      # Send actor commands like `init` and `call` to the job.
      self.job_socket = self.ctx.socket(zmq.REQ)
      self.job_socket.linger = 0
      self.job_socket.connect("tcp://{}".format(job_address))
      # check the result every 20s to detect the job is still alive.
      self.job_socket.setsockopt(zmq.RCVTIMEO, 20 * 1000)
      self.job_address = job_address
  
      self.send_file()
  
      for key in list(kwargs.keys()):
          if key.startswith(XPARL_RESERVED_PREFIX):
              del kwargs[key]
      serlization_finished = True
      try:
          self.job_socket.send_multipart(
              [
                  remote_constants.INIT_OBJECT_TAG,
                  dump_remote_class(cls),
                  cloudpickle.dumps([args, kwargs]),
              ]
          )
      except TypeError:
          serlization_finished = False
          logger.error(
              "[xparl] fail to serialize the arguments for class initialization. \n\
                          For more information, please check the documentation in: \n\
                          https://parl.readthedocs.io/en/latest/questions/distributed_training.html#recommended-data-types-in-xparl"
          )
      if not serlization_finished:
          raise RemoteSerializeError(
              "__init__", "fail to finish serialization."
          )
  
      message = self._receive_from_remote_instance("__init__")
      tag = message[0]
      if tag == remote_constants.NORMAL_TAG:
          self.remote_attribute_keys_set = loads_return(message[1])
      elif tag == remote_constants.EXCEPTION_TAG:
          traceback_str = to_str(message[1])
          self.job_is_alive.value = False
          raise RemoteError("__init__", traceback_str)
      else:
          pass
  
imports: import cloudpickle
  import sys
  import threading
  import zmq
  import multiprocessing
  from parl.utils import logger, to_str, to_byte
  from parl.remote.communication import loads_argument, loads_return, dumps_argument, dumps_return
  from parl.remote.client import get_global_client
  from parl.remote import remote_constants
  from parl.remote.exceptions import RemoteError, RemoteAttributeError, RemoteDeserializeError, RemoteSerializeError, ResourceError, FutureFunctionError
  from parl.remote.remote_class_serialization import dump_remote_class
label_desc: Use image node_id 1 to create a new RemoteWrapper object from inherited base classes: object with example: obj = RemoteWrapper()