29389772364178f76ccf565917870639cad283bb,einops.py,,get_axes_names,#,124

Before Change


def get_axes_names(composite_axis_name: str):
    // TODO add spaces and long names
    elementary_axes = []
    composite_axis_name = list(composite_axis_name)
    while len(composite_axis_name) > 0:
        letter = composite_axis_name.pop()
        if "a" <= letter <= "z" or letter == "_":
            elementary_axes.append(letter)
        else:
            assert "0" <= letter <= "9"
            prev_letter = composite_axis_name.pop()
            assert "a" <= prev_letter <= "z"
            elementary_axes.append(prev_letter + letter)
    return elementary_axes[::-1]


def transpose(tensor, pattern, **axes_lengths):

After Change



def get_axes_names(composite_axis_name: str):
    axes_names = [axis for axis in composite_axis_name.split(" ") if len(axis) > 0]
    for axis in axes_names:
        if axis == "_":
            continue
        assert "a" <= axis[0] <= "z"
        for letter in axis:
            assert str.isdigit(letter) or "a" <= letter <= "z"
    return axes_names


def transpose(tensor, pattern, **axes_lengths):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: arogozhnikov/einops
Commit Name: 29389772364178f76ccf565917870639cad283bb
Time: 2018-09-27
Author: iamfullofspam@gmail.com
File Name: einops.py
Class Name:
Method Name: get_axes_names


Project Name: theislab/scanpy
Commit Name: 37ef2c69f22a6e2d1232782dd3e192a003731a75
Time: 2020-11-25
Author: michal.klein@protonmail.com
File Name: scanpy/readwrite.py
Class Name:
Method Name: _download


Project Name: mozilla/mozregression
Commit Name: 41c79a28adb945dbb91f7bd3a8bf65703cc81bac
Time: 2020-04-20
Author: wlachance@mozilla.com
File Name: gui/mozregui/log_report.py
Class Name: LogView
Method Name: on_log_filter