class_docstr: Instantiate an object from the environment variables
class_docstr_tok: ["Instantiate","an","object","from","the","environment","variables"]
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
  :raise UnknownReferenceError: If the config refers to an unknown object
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",":","raise","UnknownReferenceError",":","If","the","config","refers","to","an","unknown","object"]
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
      :raise UnknownReferenceError: If the config refers to an unknown object
      """
      try:
          return self.builder.instantiate(
              super().instantiate(config, name), f"{name}"
          )
      except InstantiationImpossible:
          if not isinstance(config, str):
              raise InstantiationImpossible()
  
          v_upd: str = config
          for key in self.strings_to_replace:
              v_upd = v_upd.replace(f"${key}", str(self.env[key]))
  
          if v_upd.startswith("$"):
              raise UnknownReferenceError(name, config) from None
  
          logger.info(f'instantiating "{name}" using value {v_upd}')
  
          return v_upd
  
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 FromEnvironmentVariableInstantiator obj's underlying member method code with example usage: obj.instantiate(config, name) and returns: self, v_upd