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)

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
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

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: scikit-learn/scikit-learn
Commit Name: 4f496868c6aa7f50db99229847285efbe50040c2
Time: 2020-08-03
Author: 34657725+jeremiedbb@users.noreply.github.com
File Name: sklearn/cluster/tests/test_k_means.py
Class Name:
Method Name: test_n_init


Project Name: explosion/thinc
Commit Name: a6579e05569592916ad51f938db5056bc6bda817
Time: 2020-01-22
Author: tiangolo@gmail.com
File Name: thinc/mypy.py
Class Name:
Method Name: get_reducers_type