024b07ba113c58e06433890791f01dbbabcc85b8,sacred/commandline_options.py,CommandLineOption,get_flag,#Any#,36

Before Change


    def get_flag(cls):
        if cls.short_flag is None:
            assert cls.flag, "No flag specified for {}!\n".format(cls.__name__)
            return cls.flag[:1], cls.flag
        else:
            return cls.short_flag, cls.flag

    @classmethod

After Change


    def get_flag(cls):
        // Get the flag name from the class name
        flag = cls.__name__
        if flag.endswith("Option"):
            flag = flag[:-6]
        flag = convert_camel_case_to_snake_case(flag)

        if cls.short_flag is None:
            return flag[:1], flag
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: IDSIA/sacred
Commit Name: 024b07ba113c58e06433890791f01dbbabcc85b8
Time: 2015-09-07
Author: qwlouse@gmail.com
File Name: sacred/commandline_options.py
Class Name: CommandLineOption
Method Name: get_flag


Project Name: IDSIA/sacred
Commit Name: 0cd42478586c9cb1febb6b76eea068aac8869a1e
Time: 2018-01-24
Author: dismaldenizen@gmail.com
File Name: sacred/ingredient.py
Class Name: Ingredient
Method Name: __init__


Project Name: dpressel/mead-baseline
Commit Name: 126f18f45f9c7f6ea005b933854423420e6e4545
Time: 2018-09-19
Author: dpressel@gmail.com
File Name: python/baseline/data.py
Class Name: SeqWordCharDataFeed
Method Name: _batch