e797f63316a699aceb47f896da2f89588ba15667,scripts/rm_pt.py,,last_n_checkpoints,#Any#Any#,21

Before Change




def last_n_checkpoints(files, n):
    entries = []
    for f in files:
        m = pt_regexp_epoch_based.fullmatch(f)
        if m is not None:
            entries.append((int(m.group(1)), m.group(0)))
        else:
            m = pt_regexp_update_based.fullmatch(f)
            if m is not None:
                entries.append((int(m.group(1)), m.group(0)))
    return [x[1] for x in sorted(entries, reverse=True)[:n]]


def every_n_checkpoints(files, n):

After Change




def last_n_checkpoints(files, n):
    entries = parse_checkpoints(files)
    return [x[1] for x in sorted(entries, reverse=True)[:n]]


def every_n_checkpoints(files, n):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 26

Instances


Project Name: elbayadm/attn2d
Commit Name: e797f63316a699aceb47f896da2f89588ba15667
Time: 2019-05-16
Author: myleott@fb.com
File Name: scripts/rm_pt.py
Class Name:
Method Name: last_n_checkpoints


Project Name: elbayadm/attn2d
Commit Name: e797f63316a699aceb47f896da2f89588ba15667
Time: 2019-05-16
Author: myleott@fb.com
File Name: scripts/rm_pt.py
Class Name:
Method Name: every_n_checkpoints


Project Name: pytorch/fairseq
Commit Name: e797f63316a699aceb47f896da2f89588ba15667
Time: 2019-05-16
Author: myleott@fb.com
File Name: scripts/rm_pt.py
Class Name:
Method Name: last_n_checkpoints