class_docstr: TaskSampler where each task has its own constructor.
  
  Generally, this is used when the different tasks are completely different
  environments.
  
  Args:
      env_constructors (list[Callable[Environment]]): Callables that produce
          environments (for example, environment types).
class_docstr_tok: ["TaskSampler","where","each","task","has","its","own","constructor",".","Generally",",","this","is","used","when","the","different","tasks","are","completely","different","environments",".","Args",":","env_constructors","(","list","[","Callable","[","Environment","]","]",")",":","Callables","that","produce","environments","(","for","example",",","environment","types",")","."]
docstr: Sample a list of environment updates.
  
  Args:
      n_tasks (int): Number of updates to sample.
      with_replacement (bool): Whether tasks can repeat when sampled.
          Note that if more tasks are sampled than exist, then tasks may
          repeat, but only after every environment has been included at
          least once in this batch. Ignored for continuous task spaces.
  
  Returns:
      list[EnvUpdate]: Batch of sampled environment updates, which, when
          invoked on environments, will configure them with new tasks.
          See :py:class:`~EnvUpdate` for more information.
docstr_tok: ["Sample","a","list","of","environment","updates",".","Args",":","n_tasks","(","int",")",":","Number","of","updates","to","sample",".","with_replacement","(","bool",")",":","Whether","tasks","can","repeat","when","sampled",".","Note","that","if","more","tasks","are","sampled","than","exist",",","then","tasks","may","repeat",",","but","only","after","every","environment","has","been","included","at","least","once","in","this","batch",".","Ignored","for","continuous","task","spaces",".","Returns",":","list","[","EnvUpdate","]",":","Batch","of","sampled","environment","updates",",","which",",","when","invoked","on","environments",",","will","configure","them","with","new","tasks",".","See",":","py",":","class",":","`","~EnvUpdate","`","for","more","information","."]
code: def sample(self, n_tasks, with_replacement=False):
      """Sample a list of environment updates.
  
      Args:
          n_tasks (int): Number of updates to sample.
          with_replacement (bool): Whether tasks can repeat when sampled.
              Note that if more tasks are sampled than exist, then tasks may
              repeat, but only after every environment has been included at
              least once in this batch. Ignored for continuous task spaces.
  
      Returns:
          list[EnvUpdate]: Batch of sampled environment updates, which, when
              invoked on environments, will configure them with new tasks.
              See :py:class:`~EnvUpdate` for more information.
  
      """
      return [
          NewEnvUpdate(self._env_constructors[i])
          for i in _sample_indices(
              n_tasks, len(self._env_constructors), with_replacement
          )
      ]
  
imports: import abc
  import copy
  import math
  import numpy
  from garage.envs import GymEnv, TaskNameWrapper, TaskOnehotWrapper
  from garage.sampler.env_update import ExistingEnvUpdate, NewEnvUpdate, SetTaskUpdate
label_desc: Use image node_id 3 for calling the ConstructEnvsSampler obj's underlying member method code with example usage: obj.sample(n_tasks, with_replacement) and returns: unknown