class_docstr: Instantiate an object calling a registered callable
class_docstr_tok: ["Instantiate","an","object","calling","a","registered","callable"]
docstr: :param config: The config for the object to instantiate
  :param name: The full name of the object we try to instantiate
  :return: The instantiated object
  :raise InstantiationImpossible: If the instantiator cannot handle this config
  :raise UnknownPluginException: If the callable is not registered
  :raise CallableInstantiationError: If an error occurred while calling the callable
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","instantiated","object",":","raise","InstantiationImpossible",":","If","the","instantiator","can","not","handle","this","config",":","raise","UnknownPluginException",":","If","the","callable","is","not","registered",":","raise","CallableInstantiationError",":","If","an","error","occurred","while","calling","the","callable"]
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 instantiated object
      :raise InstantiationImpossible: If the instantiator cannot handle this config
      :raise UnknownPluginException: If the callable is not registered
      :raise CallableInstantiationError: If an error occurred while calling the callable
      """
      if not isinstance(config, dict) or not "_name" in config:
          raise InstantiationImpossible()
  
      klass_name: str = config["_name"]
  
      if klass_name not in REGISTRY:
          raise UnknownPluginException(
              object_name=name, registrable=klass_name
          )
  
      klass: Union[Type, Callable] = REGISTRY[klass_name]
  
      logger.info(f'instantiating "{name}" calling {klass_name}')
  
      param_instances: Dict[str, Any] = {
          key: self.builder.instantiate(value_config, f"{name}.{key}")
          for key, value_config in config.items()
          if key != "_name"
      }
  
      try:
          return klass(**param_instances)
      except Exception:
          raise CallableInstantiationError(
              obj_name=name,
              callable_name=klass_name,
              arg_names=list(param_instances.keys()),
          )
  
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 1 for calling the CallableInstantiator obj's underlying member method code with example usage: obj.instantiate(config, name) and returns: klass