cbcd301150a30da76baa29b27026d85def796e3b,lib/gui/_config.py,,get_clean_fonts,#,93

Before Change


def get_clean_fonts():
     Return the font list with any @prefixed or non-Unicode characters stripped
        and default prefixed 
    cleaned_fonts = sorted([fnt for fnt in font.families()
                            if not fnt.startswith("@") and not any([ord(c) > 127 for c in fnt])])
    return ["default"] + cleaned_fonts

After Change


    for font in fmanager.ttflist:
        if str(font.weight) in ("400", "normal", "regular"):
            fonts.setdefault(font.name, dict())["regular"] = True
        if str(font.weight) in ("700", "bold"):
            fonts.setdefault(font.name, dict())["bold"] = True
    valid_fonts = {key for key, val in fonts.items() if len(val) == 2}
    retval = sorted(list(valid_fonts.intersection(tk_font.families())))
    return ["default"] + retval
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: deepfakes/faceswap
Commit Name: cbcd301150a30da76baa29b27026d85def796e3b
Time: 2020-08-22
Author: 36920800+torzdf@users.noreply.github.com
File Name: lib/gui/_config.py
Class Name:
Method Name: get_clean_fonts


Project Name: cmu-db/ottertune
Commit Name: 21971e673fabe25d3e7da6712f80222760516113
Time: 2020-02-26
Author: bohanzhang95@gmail.com
File Name: server/website/website/tasks/async_tasks.py
Class Name:
Method Name: clean_metric_data


Project Name: codelucas/newspaper
Commit Name: 5d6cdbd53544d057a1cf344526ec70e0995b77d1
Time: 2014-12-17
Author: lucasyangpersonal@gmail.com
File Name: newspaper/nlp.py
Class Name:
Method Name: keywords