92ac048f7d5dcf86bb86e840eb5f9179cc8e114a,open_seq2seq/utils/utils.py,,check_params,#Any#Any#Any#,44

Before Change


    else:
      if vals and type(vals) is list and config[pm] not in vals:
        raise ValueError("{} has to be one of {}".format(pm, vals))
      if vals and type(vals) is not list and type(config[pm]) is not vals:
        raise ValueError("{} has to be of type {}".format(pm, vals))

  for pm, vals in optional_dict.items():
    if pm in config:
      if vals and type(vals) is list and config[pm] not in vals:
        raise ValueError("{} has to be one of {}".format(pm, vals))
      if vals and type(vals) is not list and type(config[pm]) is not vals:
        raise ValueError("{} has to be of type {}".format(pm, vals))

  for pm in config:

After Change


    else:
      if vals == str:
        vals = string_types
      if vals and isinstance(vals, list) and config[pm] not in vals:
        raise ValueError("{} has to be one of {}".format(pm, vals))
      if vals and not isinstance(vals, list) and not isinstance(config[pm], vals):
        raise ValueError("{} has to be of type {}".format(pm, vals))

  for pm, vals in optional_dict.items():
    if vals == str:
      vals = string_types
    if pm in config:
      if vals and isinstance(vals, list) and config[pm] not in vals:
        raise ValueError("{} has to be one of {}".format(pm, vals))
      if vals and not isinstance(vals, list) and not isinstance(config[pm], vals):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 11

Instances


Project Name: NVIDIA/OpenSeq2Seq
Commit Name: 92ac048f7d5dcf86bb86e840eb5f9179cc8e114a
Time: 2018-04-27
Author: igor.a.gitman@gmail.com
File Name: open_seq2seq/utils/utils.py
Class Name:
Method Name: check_params


Project Name: Microsoft/nni
Commit Name: b7366b685afdde156e551f8ba5008857f789e368
Time: 2019-02-11
Author: 871886504@qq.com
File Name: tools/nni_annotation/code_generator.py
Class Name:
Method Name: test_variable_equal


Project Name: prody/ProDy
Commit Name: 54239cd1ce143d387b24d7ae93bc4ebd61fa6f8a
Time: 2018-02-20
Author: jamesmkrieger@gmail.com
File Name: prody/utilities/catchall.py
Class Name:
Method Name: reorderMatrix