deeppavlov/core/commands/utils.py
def _parse_config_property(item: _T, variables: Dict[str, Union[str, Path, float, bool, None]]) -> _T:
    """Recursively apply config's variables values to its property"""
    if isinstance(item, str):
        return item.format(**variables)
    elif isinstance(item, list):
        return [_parse_config_property(item, variables) for item in item]
    elif isinstance(item, dict):
        return {k: _parse_config_property(v, variables) for k, v in item.items()}
    else:
        return item
def _parse_config_property(item: _T, variables: Dict[str, Union[str, Path, float, bool, None]]) -> _T:
    """Recursively apply config's variables values to its property"""
    if isinstance(item, str):
        return item.format(**variables)
    elif isinstance(item, list):
        return [_parse_config_property(item, variables) for item in item]
    elif isinstance(item, dict):
        return {k: _parse_config_property(v, variables) for k, v in item.items()}
    else:
        return item
Recursively apply config's variables values to its property