98f7bac81b00256bc31e66aab2d7752bc320e67c,odps/df/backends/optimize/utils.py,,copy_sequence,#Any#Any#Any#,44
Before Change
curr.substitute(seq, copied_seq, dag=dag)
curr = copied_seq
return copied
After Change
def copy_sequence(sequence, collection, dag=None):
if dag is None:
dag = sequence.to_dag(copy=False)
traversed = set()
copies = dict()
def copy(node):
if node._node_id not in copies:
copies[node._node_id] = node.copy()
copied = copies[node._node_id]
if not dag.contains_node(copied):
dag.add_node(copied)
return copied
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]
In pattern: SUPERPATTERN
Frequency: 4
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: 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
Project Name: kkroening/ffmpeg-python
Commit Name: 3cb952352ff0c937c1da3bf1d80142e0d8ee1e46
Time: 2017-05-25
Author: davide@depau.eu
File Name: ffmpeg/__init__.py
Class Name: _TrimNode
Method Name: _get_filter
Project Name: HyperGAN/HyperGAN
Commit Name: 58579976a05bc835084e163f4a47f12cc382e8b2
Time: 2018-08-27
Author: mikkel@255bits.com
File Name: hypergan/discriminators/configurable_discriminator.py
Class Name: ConfigurableDiscriminator
Method Name: parse_layer