code: def _check_if_vetor_env_list(env, element, function_string):
      if not isinstance(element, list) or len(element) != env.num_envs:
          raise ValueError(
              f"The element returned by {function_string} is not a "
              f"list OR the length of the returned list is not the same as the number of "
              f"sub-environments ({env.num_envs}) in your VectorEnv! "
              f"Instead, your {function_string} returned {element}"
          )
  
imports: import logging
  import traceback
  from copy import copy
  from typing import TYPE_CHECKING, Optional, Set, Union
  import numpy
  import tree
  from ray.actor import ActorHandle
  from ray.rllib.utils.annotations import DeveloperAPI
  from ray.rllib.utils.error import ERR_MSG_OLD_GYM_API, UnsupportedSpaceException
  from ray.rllib.utils.gym import check_old_gym_env, try_import_gymnasium_and_gym
  from ray.rllib.utils.spaces.space_utils import convert_element_to_space_type, get_base_struct_from_space
  from ray.rllib.utils.typing import EnvType
  from ray.util import log_once
label_desc: Use image node_id 12 for calling a global function with example usage: _check_if_vetor_env_list(env, element, function_string) without return types