b7366b685afdde156e551f8ba5008857f789e368,tools/nni_annotation/code_generator.py,,test_variable_equal,#Any#Any#,129

Before Change


        return False
    if type(var1) is ast.Name:
        return var1.id == var2.id
    if type(var1) is ast.Attribute:
        return var1.attr == var2.attr and test_variable_equal(var1.value, var2.value)
    return False


def replace_variable_node(node, annotation):

After Change


    if type(node1) is not type(node2):
        return False
    if isinstance(node1, ast.AST):
        for k, v in vars(node1).items():
            if k in ("lineno", "col_offset", "ctx"):
                continue
            if not test_variable_equal(v, getattr(node2, k)):
                return False
        return True
    if isinstance(node1, list):
        if len(node1) != len(node2):
            return False
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: microsoft/nni
Commit Name: b7366b685afdde156e551f8ba5008857f789e368
Time: 2019-02-11
Author: 871886504@qq.com
File Name: tools/nni_annotation/code_generator.py
Class Name:
Method Name: test_variable_equal


Project Name: streamlit/streamlit
Commit Name: d24989cdda816343f74a97fc32ce3fd1a689a265
Time: 2019-07-16
Author: thiago@streamlit.io
File Name: lib/streamlit/Server.py
Class Name:
Method Name: _is_url_from_allowed_origins


Project Name: chainer/chainercv
Commit Name: 90b78b1379b3423aa3b4b5d0de7313f88bda23ab
Time: 2019-02-17
Author: yuyuniitani@gmail.com
File Name: chainercv/utils/mask/mask_to_bbox.py
Class Name:
Method Name: mask_to_bbox