def renderer(path=None, string=None, default_renderer='jinja|yaml', **kwargs):
    if not path and not string:
        raise salt.exceptions.SaltInvocationError(
                'Must pass either path or string')

    renderers = salt.loader.render(__opts__, __salt__)

    if path:
        path_or_string = path
    elif string:
        path_or_string = ':string:'
        kwargs['input_data'] = string

    return salt.template.compile_template(
            path_or_string,
            renderers,
            default_renderer,
            **kwargs)
Parse a string or file through Salt's renderer system
dataset/ETHPy150Open saltstack/salt/salt/modules/slsutil.py/renderer