def format_yaml(yaml, **kwargs):
    'Formats a yaml template.\n\n    Example usage:\n        format_yaml(\'{"abc": ${x.y}}\', x={\'y\': 123})\n    output should be  \'{"abc": 123}\'\n    '
    template = _YamlTemplate(yaml)
    try:
        return template.substitute(flatten((kwargs or {}), reducer='dot'))
    except KeyError as e:
        raise RuntimeError('Unknown placeholder: {}'.format(e.args[0])) from e
Formats a yaml template.

Example usage:
    format_yaml('{"abc": ${x.y}}', x={'y': 123})
output should be  '{"abc": 123}'
def format_yaml(yaml, **kwargs):
    'Formats a yaml template.\n\n    Example usage:\n        format_yaml(\'{"abc": ${x.y}}\', x={\'y\': 123})\n    output should be  \'{"abc": 123}\'\n    '
    template = _YamlTemplate(yaml)
    try:
        return template.substitute(flatten((kwargs or {}), reducer='dot'))
    except KeyError as e:
        raise RuntimeError('Unknown placeholder: {}'.format(e.args[0])) from e