class_docstr: Wraps a function to reload global state before it executes in a subprocess.
  
  The `__call__` method calls `target()` after reloading global state;
  it also logs any errors to stderr.  After creation, this object
  will be pickled by the multiprocessing module; and its __call__ method
  is executed in the subprocess.  We take great care to safely pickle
  all global state returned from the state savers (see the
  `extra_state_savers` arguments to handle_main, handle_test_main, etc).
  
  The `__call__` also captures exceptions and logs them to stderr of the
  main process.
class_docstr_tok: ["Wraps","a","function","to","reload","global","state","before","it","executes","in","a","subprocess",".","The","`","__call__","`","method","calls","`","target","(",")","`","after","reloading","global","state",";","it","also","logs","any","errors","to","stderr",".","After","creation",",","this","object","will","be","pickled","by","the","multiprocessing","module",";","and","its","__call__","method","is","executed","in","the","subprocess",".","We","take","great","care","to","safely","pickle","all","global","state","returned","from","the","state","savers","(","see","the","`","extra_state_savers","`","arguments","to","handle_main",",","handle_test_main",",","etc",")",".","The","`","__call__","`","also","captures","exceptions","and","logs","them","to","stderr","of","the","main","process","."]
docstr: Load global state and run target function.
  
  This function runs on the subprocess.
  
  Args:
    *args: Arguments to target.
    **kwargs: Keyword arguments to target.
  
  Returns:
    Return value of target.
  
  Raises:
    Reraises any exceptions by target.
docstr_tok: ["Load","global","state","and","run","target","function",".","This","function","runs","on","the","subprocess",".","Args",":","*","args",":","Arguments","to","target",".","*","*","kwargs",":","Keyword","arguments","to","target",".","Returns",":","Return","value","of","target",".","Raises",":","Reraises","any","exceptions","by","target","."]
code: def __call__(self, *args, **kwargs):
      """Load global state and run target function.
  
      This function runs on the subprocess.
  
      Args:
        *args: Arguments to target.
        **kwargs: Keyword arguments to target.
  
      Returns:
        Return value of target.
  
      Raises:
        Reraises any exceptions by target.
      """
      try:
          if len(_STATE_SAVERS) != len(self._global_state):
              raise RuntimeError(
                  "Expected number of state savers to match count of state values, "
                  "but saw {} vs. {}".format(
                      len(_STATE_SAVERS), self._global_state
                  )
              )
  
          # Deserialize and restore global state
          for saver, state in zip(_STATE_SAVERS, self._global_state):
              if state is not None:
                  saver.restore_state(cloudpickle.loads(state))
  
          # Perform the actual computation
          target = cloudpickle.loads(self._target)
          return target(*args, **kwargs)
      except Exception as e:
          logger = self._context.log_to_stderr()
          logger.error(e)
          raise e
  
imports: import multiprocessing
  from typing import Text
  import cloudpickle
  import gin
  import gym
  from tf_agents.system.default import multiprocessing_core
  from tf_agents.system.default.multiprocessing_core import *
label_desc: Use image node_id 2 for calling the _WrappedTargetWithState obj's underlying member method code with example usage: obj.__call__() and returns: target