700abc65fd2172a2c6809dd9b72cf50fc2407772,allennlp/common/from_params.py,,create_kwargs,#Any#Any#Any#,121

Before Change


    // superclass constructor, to see if there are arguments there that we should try to also
    // constructor.
    has_kwargs = False
    for param in parameters.values():
        if param.kind == param.VAR_KEYWORD:
            has_kwargs = True
    if has_kwargs:
        // "mro" is "method resolution order".  The first one is the current class, the next is the
        // first superclass, and so on.  Taking the first superclass should work in all cases that
        // we"re looking for here.

After Change


        // with multiple values for a single parameter (e.g., the default value gives you lazy=False
        // for a dataset reader inside **kwargs, but a particular dataset reader actually hard-codes
        // lazy=True - the superclass sees both lazy=True and lazy=False in its constructor).
        if constructed_arg is not param.default:
            kwargs[param_name] = constructed_arg

    params.assert_empty(cls.__name__)
    return kwargs

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: allenai/allennlp
Commit Name: 700abc65fd2172a2c6809dd9b72cf50fc2407772
Time: 2020-02-03
Author: mattg@allenai.org
File Name: allennlp/common/from_params.py
Class Name:
Method Name: create_kwargs


Project Name: NTMC-Community/MatchZoo
Commit Name: e63c463a3200d9843bc5be6c1c3ee36fb267cbde
Time: 2018-12-29
Author: i@uduse.com
File Name: matchzoo/engine/param_table.py
Class Name: ParamTable
Method Name: hyper_space


Project Name: dmlc/gluon-cv
Commit Name: 2318052dc79966bf36675606b7d992a347418292
Time: 2019-01-07
Author: cheungchih@gmail.com
File Name: scripts/detection/ssd/train_ssd.py
Class Name:
Method Name: