class_docstr: Supports the creation of instances from configuration, that can be plugged into the environments
  (like demand generators or reward schemes).
  
  :param base_type: A common interface (parent class) of the registered types (e.g. DemandGenerator)
class_docstr_tok: ["Supports","the","creation","of","instances","from","configuration",",","that","can","be","plugged","into","the","environments","(","like","demand","generators","or","reward","schemes",")",".",":","param","base_type",":","A","common","interface","(","parent","class",")","of","the","registered","types","(","e.g",".","DemandGenerator",")"]
docstr: Instantiates objects specified in a list or dictionary.
  
  :param config: A list or dictionary of individual configs, passed to `instantiate()`
  :param kwargs: Additional arguments that are merged with the configuration dictionary (useful to sideload
                 objects that can not conveniently be specified in the config, e.g. a shared RandomState)
  
  :return A dictionary with either integers (in case config is given as list) or strings as keys and the newly
          created instances as values.
docstr_tok: ["Instantiates","objects","specified","in","a","list","or","dictionary",".",":","param","config",":","A","list","or","dictionary","of","individual","configs",",","passed","to","`","instantiate","(",")","`",":","param","kwargs",":","Additional","arguments","that","are","merged","with","the","configuration","dictionary","(","useful","to","sideload","objects","that","can","not","conveniently","be","specified","in","the","config",",","e.g",".","a","shared","RandomState",")",":","return","A","dictionary","with","either","integers","(","in","case","config","is","given","as","list",")","or","strings","as","keys","and","the","newly","created","instances","as","values","."]
code: def instantiate_collection(
      self, config: CollectionOfConfigType, **kwargs: Any
  ) -> Dict[Union[str, int], BaseType]:
      """Instantiates objects specified in a list or dictionary.
  
      :param config: A list or dictionary of individual configs, passed to `instantiate()`
      :param kwargs: Additional arguments that are merged with the configuration dictionary (useful to sideload
                     objects that can not conveniently be specified in the config, e.g. a shared RandomState)
  
      :return A dictionary with either integers (in case config is given as list) or strings as keys and the newly
              created instances as values.
      """
      if isinstance(config, Sequence):
          return {
              idx: self.instantiate(a, **kwargs)
              for idx, a in enumerate(config)
          }
      if isinstance(config, Mapping):
          assert "_target_" not in config, (
              "expected a dictionary of config objects, "
              "but received an instance config instead"
          )
  
          return {
              k: self.instantiate(v, **kwargs)
              for k, v in config.items()
          }
  
      raise ValueError(f"unexpected collection type {config}")
  
file_path: maze/maze/core/utils/factory.py
imports: import copy
  import importlib
  from typing import TypeVar, Type, Dict, Union, Any, List, Mapping, Generic, Tuple, Sequence, Callable
  import omegaconf
  from hydra.utils import instantiate
  from omegaconf import open_dict, DictConfig
label_desc: Use image node_id 3 for calling the Factory obj's underlying member method code with example usage: obj.instantiate_collection(config) and returns: unknown, unknown