(cls, yaml: str)
return cls.load_dict(config=config)
Instantiate the config from a YAML string
Instantiate the config from a YAML string
Instantiate the config from a YAML string
def load_yaml(cls, yaml: str):
        """Instantiate the config from a YAML string"""
        config = yamllib.safe_load(yaml)
        if not isinstance(config, dict):
            raise UnexpectedConfigurationFormat(
                f"The config file was loaded but it appears to be in an unexpected format. "
                f"The root of the configuration should be a key/value mapping, but the "
                f"type '{type(config).__name__}' was found instead. Check your config "
                f"file is correctly formatted."
            )
        return cls.load_dict(config=config)
def load_yaml ( cls , yaml : str ) : config = yamllib . safe_load ( yaml ) if not isinstance ( config , dict ) : raise UnexpectedConfigurationFormat ( f"The config file was loaded but it appears to be in an unexpected format. " f"The root of the configuration should be a key/value mapping, but the " f"type '{type(config).__name__}' was found instead. Check your config " f"file is correctly formatted." ) return cls . load_dict ( config = config )