0c0feda83426ce807d69bbd0f51085e07aad10b9,homeassistant/helpers/template.py,,render,#Any#Any#Any#,42

Before Change


    utcnow = dt_util.utcnow()

    try:
        return ENV.from_string(template, {
            "closest": location_methods.closest,
            "distance": location_methods.distance,
            "float": forgiving_float,
            "is_state": hass.states.is_state,
            "is_state_attr": hass.states.is_state_attr,
            "now": dt_util.as_local(utcnow),
            "states": AllStates(hass),
            "utcnow": utcnow,
            "as_timestamp": dt_util.as_timestamp,
            "relative_time": dt_util.get_age
        }).render(kwargs).strip()
    except jinja2.TemplateError as err:
        raise TemplateError(err)

After Change


        kwargs.update(variables)

    try:
        if not isinstance(template, jinja2.Template):
            template = compile_template(hass, template)

        return template.render(kwargs).strip()
    except jinja2.TemplateError as err:
        raise TemplateError(err)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: home-assistant/home-assistant
Commit Name: 0c0feda83426ce807d69bbd0f51085e07aad10b9
Time: 2016-09-25
Author: paulus@paulusschoutsen.nl
File Name: homeassistant/helpers/template.py
Class Name:
Method Name: render


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c9949c1bf26f2a18de24176bb5ce9778834bcdd2
Time: 2020-03-20
Author: beat.buesser@ie.ibm.com
File Name: art/attacks/evasion/adversarial_patch/adversarial_patch.py
Class Name: AdversarialPatch
Method Name: __init__


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 573314f4b6377764d40f9514cd89f835bf191ee4
Time: 2020-03-30
Author: beat.buesser@ie.ibm.com
File Name: art/attacks/evasion/adversarial_patch/adversarial_patch_numpy.py
Class Name: AdversarialPatchNumpy
Method Name: __init__