class_docstr: Instantiate an object looking for its reference in a Mapping object
class_docstr_tok: ["Instantiate","an","object","looking","for","its","reference","in","a","Mapping","object"]
docstr: :param config: The config for the object to instantiate
  :param name: The full name of the object we try to instantiate
  :return: The resulting object
  :raise InstantiationImpossible: If the instantiator cannot handle this config
docstr_tok: [":","param","config",":","The","config","for","the","object","to","instantiate",":","param","name",":","The","full","name","of","the","object","we","try","to","instantiate",":","return",":","The","resulting","object",":","raise","InstantiationImpossible",":","If","the","instantiator","can","not","handle","this","config"]
code: def instantiate(
      self, config: Union[Dict, str, List], name: str
  ) -> Any:
      """
      :param config: The config for the object to instantiate
      :param name: The full name of the object we try to instantiate
      :return: The resulting object
      :raise InstantiationImpossible: If the instantiator cannot handle this config
      """
  
      if not isinstance(config, str) or not config.startswith("$"):
          raise InstantiationImpossible
      try:
          instance = self.env[config[1:]]
          logger.info(
              f'instantiating "{name}" using value {instance} from key {config} in {self.mapping_name}'
          )
          return instance
      except KeyError:
          raise InstantiationImpossible
  
imports: import logging
  import os
  import traceback
  from abc import ABCMeta, abstractmethod
  from pathlib import Path
  from typing import Any, Callable, Dict, List, Mapping, Type, Union
  import toml
  import yaml
label_desc: Use image node_id 2 for calling the FromMappingInstantiator obj's underlying member method code with example usage: obj.instantiate(config, name) and returns: instance