bf464d7ed9283988fea1f548a11a0171fd2ff364,keras/utils/version_utils.py,,swap_class,#Any#Any#Any#Any#,97

Before Change


    return v1_cls

  // Recursively search superclasses to swap in the right Keras class.
  cls.__bases__ = tuple(
      swap_class(base, v2_cls, v1_cls, use_v2) for base in cls.__bases__)
  return cls


def disallow_legacy_graph(cls_name, method_name):

After Change


  // Recursively search superclasses to swap in the right Keras class.
  new_bases = []
  for base in cls.__bases__:
    if ((use_v2 and issubclass(base, v1_cls)
         or (not use_v2 and issubclass(base, v2_cls)))):
      new_base = swap_class(base, v2_cls, v1_cls, use_v2)
    else:
      new_base = base
    new_bases.append(new_base)
  cls.__bases__ = tuple(new_bases)
  return cls
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 8

Instances


Project Name: keras-team/keras
Commit Name: bf464d7ed9283988fea1f548a11a0171fd2ff364
Time: 2021-01-06
Author: gardener@tensorflow.org
File Name: keras/utils/version_utils.py
Class Name:
Method Name: swap_class


Project Name: tensorflow/tensorflow
Commit Name: fd758534e21a68dfc934cf5dff3fe4183986df51
Time: 2021-01-06
Author: gardener@tensorflow.org
File Name: tensorflow/python/keras/utils/version_utils.py
Class Name:
Method Name: swap_class


Project Name: pantsbuild/pants
Commit Name: d064804b3acf89a30fefae3f6900f0414e3e3416
Time: 2019-04-20
Author: stuhood@twitter.com
File Name: src/python/pants/init/engine_initializer.py
Class Name: EngineInitializer
Method Name: _make_goal_map_from_rules