47057e8eab93eeb3d996d9e4b1c63fd4aaec48f5,deepchem/nn/activations.py,,get_from_module,#Any#Any#Any#Any#Any#,4

Before Change


        ValueError: if the identifier cannot be found.
    
    //if isinstance(identifier, str) or isinstance(identifier, unicode):
    assert not isinstance(identifier, dict)
    res = module_params.get(identifier)
    if not res:
        raise ValueError("Invalid " + str(module_name) + ": " +
                         str(identifier))

After Change


    // Raises
        ValueError: if the identifier cannot be found.
    
    if isinstance(identifier, six.string_types):
      res = module_params.get(identifier)
      if not res:
          raise ValueError("Invalid " + str(module_name) + ": " +
                           str(identifier))
      if instantiate and not kwargs:
          return res()
      elif instantiate and kwargs:
          return res(**kwargs)
      else:
          return res
    elif isinstance(identifier, dict):
        name = identifier.pop("name")
        res = module_params.get(name)
        if res:
            return res(**identifier)
        else:
            raise ValueError("Invalid " + str(module_name) + ": " +
                             str(identifier))
    return identifier

def softmax(x):
    ndim = K.ndim(x)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: deepchem/deepchem
Commit Name: 47057e8eab93eeb3d996d9e4b1c63fd4aaec48f5
Time: 2017-01-13
Author: bharath.ramsundar@gmail.com
File Name: deepchem/nn/activations.py
Class Name:
Method Name: get_from_module


Project Name: tensorflow/cleverhans
Commit Name: 7fc360e926a0562e46e3ebdb2d2768d3fa3e8e7c
Time: 2018-11-09
Author: goodfellow@google.com
File Name: cleverhans/confidence_report.py
Class Name: ConfidenceReport
Method Name: __setitem__


Project Name: tensorflow/cleverhans
Commit Name: 441accc27b11dbc2ef20a028eba5c4fb2576162c
Time: 2018-10-24
Author: goodfellow@google.com
File Name: cleverhans/attacks.py
Class Name: Attack
Method Name: construct_variables