class_docstr: Vectorized environment that runs multiple environments in parallel.
  
  It uses ``multiprocessing`` processes, and pipes for communication.
  
  Example::
  
      >>> import gym
      >>> env = gym.vector.AsyncVectorEnv([
      ...     lambda: gym.make("Pendulum-v0", g=9.81),
      ...     lambda: gym.make("Pendulum-v0", g=1.62)
      ... ])
      >>> env.reset()
      array([[-0.8286432 ,  0.5597771 ,  0.90249056],
             [-0.85009176,  0.5266346 ,  0.60007906]], dtype=float32)
class_docstr_tok: ["Vectorized","environment","that","runs","multiple","environments","in","parallel",".","It","uses","``","multiprocessing","``","processes",",","and","pipes","for","communication",".","Example",":",":",">",">",">","import","gym",">",">",">","env","=","gym.vector.AsyncVectorEnv","(","[","...","lambda",":","gym.make","(","``","Pendulum-v0","''",",","g=9.81",")",",","...","lambda",":","gym.make","(","``","Pendulum-v0","''",",","g=1.62",")","...","]",")",">",">",">","env.reset","(",")","array","(","[","[","-0.8286432",",","0.5597771",",","0.90249056","]",",","[","-0.85009176",",","0.5266346",",","0.60007906","]","]",",","dtype=float32",")"]
docstr: Sets an attribute of the sub-environments.
  
  Args:
      name: Name of the property to be set in each individual environment.
      values: Values of the property to be set to. If ``values`` is a list or
          tuple, then it corresponds to the values for each individual
          environment, otherwise a single value is set for all environments.
  
  Raises:
      ValueError: Values must be a list or tuple with length equal to the number of environments.
      AlreadyPendingCallError: Calling `set_attr` while waiting for a pending call to complete.
docstr_tok: ["Sets","an","attribute","of","the","sub-environments",".","Args",":","name",":","Name","of","the","property","to","be","set","in","each","individual","environment",".","values",":","Values","of","the","property","to","be","set","to",".","If","``","values","``","is","a","list","or","tuple",",","then","it","corresponds","to","the","values","for","each","individual","environment",",","otherwise","a","single","value","is","set","for","all","environments",".","Raises",":","ValueError",":","Values","must","be","a","list","or","tuple","with","length","equal","to","the","number","of","environments",".","AlreadyPendingCallError",":","Calling","`","set_attr","`","while","waiting","for","a","pending","call","to","complete","."]
code: def set_attr(self, name: str, values: Union[list, tuple, object]):
      """Sets an attribute of the sub-environments.
  
      Args:
          name: Name of the property to be set in each individual environment.
          values: Values of the property to be set to. If ``values`` is a list or
              tuple, then it corresponds to the values for each individual
              environment, otherwise a single value is set for all environments.
  
      Raises:
          ValueError: Values must be a list or tuple with length equal to the number of environments.
          AlreadyPendingCallError: Calling `set_attr` while waiting for a pending call to complete.
      """
      self._assert_is_running()
      if not isinstance(values, (list, tuple)):
          values = [values for _ in range(self.num_envs)]
      if len(values) != self.num_envs:
          raise ValueError(
              "Values must be a list or tuple with length equal to the "
              f"number of environments. Got `{len(values)}` values for "
              f"{self.num_envs} environments."
          )
  
      if self._state != AsyncState.DEFAULT:
          raise AlreadyPendingCallError(
              "Calling `set_attr` while waiting "
              f"for a pending call to `{self._state.value}` to complete.",
              self._state.value,
          )
  
      for pipe, value in zip(self.parent_pipes, values):
          pipe.send(("_setattr", (name, value)))
      _, successes = zip(*[pipe.recv() for pipe in self.parent_pipes])
      self._raise_if_errors(successes)
  
imports: import multiprocessing
  import sys
  import time
  from copy import deepcopy
  from enum import Enum
  from typing import List, Optional, Sequence, Tuple, Union
  import numpy
  import gym
  from gym import logger
  from gym.core import ObsType
  from gym.error import AlreadyPendingCallError, ClosedEnvironmentError, CustomSpaceError, NoAsyncCallError
  from gym.vector.utils import CloudpickleWrapper, clear_mpi_env_vars, concatenate, create_empty_array, create_shared_memory, iterate, read_from_shared_memory, write_to_shared_memory
  from gym.vector.vector_env import VectorEnv
label_desc: Use image node_id 8 for calling the AsyncVectorEnv obj's underlying member method code with example usage: obj.set_attr(name, values) without return types