dgs.utils.loader.get_instance_from_name¶
- dgs.utils.loader.get_instance_from_name(name: str, instances: dict[str, Type[I]]) Type[I] [source]¶
Given the name of an instance and the dict containing a mapping from name to class, get the class.
- Parameters:
name – The name of the instance to add to
instances
.instances – A dictionary containing a mapping from instance name to instance class.
- Returns:
The class-type of the instance.
- Raises:
ValueError if the instance name is not present in instances. –