0b92b4f5530fee68432f13075a1ddc866748f9d1,examples/showcase/firefox.py,,svg_parse,#Any#,19

Before Change


                "C": (Path.CURVE4,)*3,
                "Z": (Path.CLOSEPOLY,)}
    path_re = re.compile(r"([MLHVCSQTAZ])([^MLHVCSQTAZ]+)", re.IGNORECASE)
    float_re = re.compile(r"(?:[\s,]*)([+-]?\d+(?:\.\d+)?)")
    vertices = []
    codes = []
    last = (0, 0)
    for cmd, values in path_re.findall(path):
        points = [float(v) for v in float_re.findall(values)]
        points = np.array(points).reshape((len(points)//2, 2))
        if cmd.islower():
            points += last
        cmd = cmd.capitalize()
        last = points[-1]
        codes.extend(commands[cmd])
        vertices.extend(points.tolist())
    return codes, vertices

After Change


                "Z": (Path.CLOSEPOLY,)}
    vertices = []
    codes = []
    cmd_values = re.split("([A-Za-z])", path)[1:]  // Split over commands.
    for cmd, values in zip(cmd_values[::2], cmd_values[1::2]):
        // Numbers are separated either by commas, or by +/- signs (but not at
        // the beginning of the string).
        points = ([*map(float, re.split(",|(?<!^)(?=[+-])", values))] if values
                  else [(0., 0.)])  // Only for "z/Z" (CLOSEPOLY).
        points = np.reshape(points, (-1, 2))
        if cmd.islower():
            points += vertices[-1][-1]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: matplotlib/matplotlib
Commit Name: 0b92b4f5530fee68432f13075a1ddc866748f9d1
Time: 2020-11-20
Author: anntzer.lee@gmail.com
File Name: examples/showcase/firefox.py
Class Name:
Method Name: svg_parse


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: c84eb9306a521ddcefe8ca805ac633408e5b312a
Time: 2015-05-09
Author: voellm@google.com
File Name: perfkitbenchmarker/benchmarks/iperf_benchmark.py
Class Name:
Method Name: _RunIperf


Project Name: samuelclay/NewsBlur
Commit Name: 06e94610dc2d71997ca567b45df02f5ea7613a81
Time: 2009-11-15
Author: samuel@ofbrooklyn.com
File Name: apps/analyzer/classifier.py
Class Name: Classifier
Method Name: get_features