8fb7199f713add3edda0bf97d72aebc2c3df4efe,tensorflow_datasets/core/utils/py_utils.py,memoized_property,__get__,#memoized_property#Any#Any#,50

Before Change


      return None
    // The function is called only once per instance for loading the first time
    value = self.fct(instance)
    setattr(instance, self.fct.__name__, value)  // Overwrite the descriptor
    return value

After Change


    if self.fget is None:
      raise AttributeError("unreadable attribute")
    attr = "__cached_" + self.fget.__name__
    cached = getattr(obj, attr, None)
    if cached is None:
      cached = self.fget(obj)
      setattr(obj, attr, cached)
    return cached
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: tensorflow/datasets
Commit Name: 8fb7199f713add3edda0bf97d72aebc2c3df4efe
Time: 2018-12-05
Author: rsepassi@google.com
File Name: tensorflow_datasets/core/utils/py_utils.py
Class Name: memoized_property
Method Name: __get__


Project Name: NVIDIA/sentiment-discovery
Commit Name: 5e37bb3ea1bed3f329ff825eaa6c7b9ed92edb15
Time: 2017-12-20
Author: raulp@gcf-ctrl-01.nvidia.com
File Name: sentiment_discovery/reparameterization/reparameterization.py
Class Name: Reparameterization
Method Name: __call__


Project Name: explosion/thinc
Commit Name: 152e4cec0c09111f064b80832eed7134e7a9cffc
Time: 2020-01-15
Author: ines@ines.io
File Name: thinc/optimizers.py
Class Name: Optimizer
Method Name: step_schedules


Project Name: biolab/orange3
Commit Name: c073de4002f7a72babc8fd6ecdcd90c141be2c08
Time: 2013-01-21
Author: janez.demsar@fri.uni-lj.si
File Name: Orange/widgets/utils/datacaching.py
Class Name:
Method Name: setCached