def parse_config(config: Union[str, Path, dict], overwrite: Optional[dict] = None) -> dict:
    """Apply metadata.variables values to placeholders inside config and update nested configs using overwrite parameter

    Args:
        config: Config to parse.
        overwrite: If not None - key-value pairs of nested keys and values to overwrite config.
            For {'chainer.pipe.0.class_name': 'simple_vocab'} it will update config
            config['chainer']['pipe'][0]['class_name'] = 'simple_vocab'.

    """
    if isinstance(config, (str, Path)):
        config = read_json(find_config(config))

    if overwrite is not None:
        for key, value in overwrite.items():
            items = [int(item) if item.isdigit() else item for item in key.split('.')]
            _overwrite(config, value, items)

    updated_config = _update_requirements(config)

    variables, variables_exact = _get_variables_from_config(updated_config)

    return _parse_config_property(updated_config, variables, variables_exact)
Apply metadata.variables values to placeholders inside config and update nested configs using overwrite parameter

    Args:
        config: Config to parse.
        overwrite: If not None - key-value pairs of nested keys and values to overwrite config.
            For {'chainer.pipe.0.class_name': 'simple_vocab'} it will update config
            config['chainer']['pipe'][0]['class_name'] = 'simple_vocab'.

    
deeppavlov/core/commands/utils.py