98f7bac81b00256bc31e66aab2d7752bc320e67c,odps/df/backends/optimize/utils.py,,copy_sequence,#Any#Any#Any#,44

Before Change


    is_copied = set()
    for path in sequence.all_path(collection, strict=True):
        curr = copied
        for seq in path[1:-1]:
            if id(seq) in is_copied:
                continue
            is_copied.add(id(seq))
            copied_seq = seq.copy()
            curr.substitute(seq, copied_seq, dag=dag)
            curr = copied_seq

    return copied

After Change



    for n in sequence.traverse(top_down=True, traversed=traversed,
                               stop_cond=lambda x: x is collection, unique=True):
        if n is sequence:
            copy(n)
            continue
        if n is collection:
            continue

        parents = [p for p in dag.successors(n) if p._node_id in traversed]
        for parent in parents:
            copy(parent).substitute(n, copy(n), dag=dag)

    return copies[sequence._node_id]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: aliyun/aliyun-odps-python-sdk
Commit Name: 98f7bac81b00256bc31e66aab2d7752bc320e67c
Time: 2017-08-03
Author: xuye.qin@alibaba-inc.com
File Name: odps/df/backends/optimize/utils.py
Class Name:
Method Name: copy_sequence


Project Name: pantsbuild/pants
Commit Name: 699600d95b2b30291b26b8051cc379c0452e8c25
Time: 2013-04-09
Author: markcc@foursquare.com
File Name: src/python/twitter/pants/tasks/java_compile.py
Class Name: JavaCompile
Method Name: execute_single_compilation


Project Name: pantsbuild/pants
Commit Name: 9f236fd5795b60f8f75d77e20189dbeabc123814
Time: 2013-04-04
Author: benjy@foursquare.com
File Name: src/python/twitter/pants/tasks/java_compile.py
Class Name: JavaCompile
Method Name: execute_single_compilation


Project Name: aliyun/aliyun-odps-python-sdk
Commit Name: 98f7bac81b00256bc31e66aab2d7752bc320e67c
Time: 2017-08-03
Author: xuye.qin@alibaba-inc.com
File Name: odps/df/backends/optimize/utils.py
Class Name:
Method Name: copy_sequence