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

Before Change


                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)
            try:
                if extensions[idx+1] == "" or ext == extensions[idx+1]:
                    groups[basename].append(f)
            except KeyError:
                pass
    
    if validity_check:
        lens = [len(groups[k]) for k in groups.keys()]
        if len(set(lens)) > 1:
            raise ValueError("Warning, some keys have more/less values than others. Set validity_check=False to ignore this warning.")

    return groups
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

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: commonsense/conceptnet5
Commit Name: 952f26f1f16ac30315f799e163106a688fc05cb7
Time: 2018-05-14
Author: joanna.teresa.duda@gmail.com
File Name: conceptnet5/vectors/transforms.py
Class Name:
Method Name: choose_small_vocabulary


Project Name: WheatonCS/Lexos
Commit Name: ba5ce0dcacefae377a199b2b6115263528fa8bad
Time: 2017-08-07
Author: weltch1997@gmail.com
File Name: lexos/processors/analyze/topword.py
Class Name:
Method Name: analyze_all_to_para