class_docstr: Samples episodes in a data-parallel fashion using a Ray cluster.
  
  The sampler need to be created either from a worker factory or from
  parameters which can construct a worker factory. See the __init__ method
  of WorkerFactory for the detail of these parameters.
  
  Args:
      agents (list[Policy]): Agents to distribute across workers.
      envs (list[Environment]): Environments to distribute across workers.
      worker_factory (WorkerFactory): Used for worker behavior. Either this
          param or params after this are required to construct a sampler.
      max_episode_length(int): Params used to construct a worker factory.
          The maximum length episodes which will be sampled.
      is_tf_worker (bool): Whether it is workers for TFTrainer.
      seed(int): The seed to use to initialize random number generators.
      n_workers(int): The number of workers to use.
      worker_class(type): Class of the workers. Instances should implement
          the Worker interface.
      worker_args (dict or None): Additional arguments that should be passed
          to the worker.
class_docstr_tok: ["Samples","episodes","in","a","data-parallel","fashion","using","a","Ray","cluster",".","The","sampler","need","to","be","created","either","from","a","worker","factory","or","from","parameters","which","can","construct","a","worker","factory",".","See","the","__init__","method","of","WorkerFactory","for","the","detail","of","these","parameters",".","Args",":","agents","(","list","[","Policy","]",")",":","Agents","to","distribute","across","workers",".","envs","(","list","[","Environment","]",")",":","Environments","to","distribute","across","workers",".","worker_factory","(","WorkerFactory",")",":","Used","for","worker","behavior",".","Either","this","param","or","params","after","this","are","required","to","construct","a","sampler",".","max_episode_length","(","int",")",":","Params","used","to","construct","a","worker","factory",".","The","maximum","length","episodes","which","will","be","sampled",".","is_tf_worker","(","bool",")",":","Whether","it","is","workers","for","TFTrainer",".","seed","(","int",")",":","The","seed","to","use","to","initialize","random","number","generators",".","n_workers","(","int",")",":","The","number","of","workers","to","use",".","worker_class","(","type",")",":","Class","of","the","workers",".","Instances","should","implement","the","Worker","interface",".","worker_args","(","dict","or","None",")",":","Additional","arguments","that","should","be","passed","to","the","worker","."]
docstr: Unpickle the state.
  
  Args:
      state (dict): Unpickled state.
docstr_tok: ["Unpickle","the","state",".","Args",":","state","(","dict",")",":","Unpickled","state","."]
code: def __setstate__(self, state):
      """Unpickle the state.
  
      Args:
          state (dict): Unpickled state.
  
      """
      self.__init__(
          state["agents"],
          state["envs"],
          worker_factory=state["factory"],
      )
  
imports: from collections import defaultdict
  import itertools
  import click
  import cloudpickle
  import psutil
  import ray
  from garage import EpisodeBatch
  from garage.experiment.deterministic import get_seed
  from garage.sampler.default_worker import DefaultWorker
  from garage.sampler.sampler import Sampler
  from garage.sampler.worker_factory import WorkerFactory
label_desc: Use image node_id 9 for calling the RaySampler obj's underlying member method code with example usage: obj.__setstate__(state) without return types