c9e82bb1ab323d4a79793e47dbdd9204302e36af,mlxtend/file_io/find.py,,find_filegroups,#,68

Before Change


    base = find_files(path=paths[0],  substring=substring, check_ext=extensions[0], ignore_invisible=ignore_invisible, ignore_substring=ignore_substring)
    rest = [find_files(path=paths[i],  substring=substring, check_ext=extensions[i], ignore_invisible=ignore_invisible, ignore_substring=ignore_substring) for i in range(1,n)] 
    
    groups = {os.path.splitext(os.path.basename(f))[0].rstrip(rstrip):[f] for f in base}
    
    for idx,r in enumerate(rest):
        for f in r:
            basename, ext = os.path.splitext(os.path.basename(f))
            basename = basename.rstrip(rstrip)
            try:
                if extensions[idx+1] == "" or ext == extensions[idx+1]:
                    groups[basename].append(f)
            except KeyError:
                pass
    
    if validity_check:
        num = sorted([(len(v),k) for k,v in groups.items()])
        for i in num[1:]:
            if i[0] < num[0][0]:
                print("Warning, key "%s" has less values than "key" %s." % (i[1], num[0][1]))
                groups = {}

After Change


    rest = [find_files(path=paths[i],  substring=substring, check_ext=extensions[i], ignore_invisible=ignore_invisible, ignore_substring=ignore_substring) for i in range(1,n)] 
    
    groups = {}
    for f in base:
        basename = os.path.splitext(os.path.basename(f))[0]
        basename = re.sub("\%s$" % rstrip, "", basename)
        groups[basename] = [f]
    
    //groups = {os.path.splitext(os.path.basename(f))[0].rstrip(rstrip):[f] for f in base}
    
    for idx,r in enumerate(rest):
        for f in r:
            basename, ext = os.path.splitext(os.path.basename(f))
            basename = re.sub("\%s$" % rstrip, "", basename)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: rasbt/mlxtend
Commit Name: c9e82bb1ab323d4a79793e47dbdd9204302e36af
Time: 2015-04-06
Author: se.raschka@me.com
File Name: mlxtend/file_io/find.py
Class Name:
Method Name: find_filegroups


Project Name: dmlc/dgl
Commit Name: 16861063909843a9e9cdae82c35b1acf2708278c
Time: 2021-02-24
Author: coin2028@hotmail.com
File Name: python/dgl/view.py
Class Name: HeteroNodeDataView
Method Name: __repr__


Project Name: dmlc/dgl
Commit Name: 16861063909843a9e9cdae82c35b1acf2708278c
Time: 2021-02-24
Author: coin2028@hotmail.com
File Name: python/dgl/view.py
Class Name: HeteroEdgeDataView
Method Name: __repr__