code: def _check_info(info, base_env=False, agent_ids=None):
      if base_env:
          for _, multi_agent_dict in info.items():
              for agent_id, inf in multi_agent_dict.items():
                  if not isinstance(inf, dict):
                      raise ValueError(
                          "Your step function must return infos that are a dict. "
                          f"instead was a {type(inf)}: element: {inf}"
                      )
                  if not (
                      agent_id in agent_ids or agent_id == "__all__"
                  ):
                      error = (
                          f"Your dones dictionary must have agent ids that belong to "
                          f"the environment. Agent_ids recieved from "
                          f"env.get_agent_ids() are: {agent_ids}"
                      )
                      raise ValueError(error)
      elif not isinstance(info, dict):
          error = (
              "Your step function must return a info that "
              f"is a dict. element type: {type(info)}. element: {info}"
          )
          raise ValueError(error)
  
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 8 for calling a global function with example usage: _check_info(info, base_env, agent_ids) without return types