14759e1065e307c7760299670da30f64ffdbf783,src/python/pants/engine/engine.py,LocalSerialEngine,reduce,#LocalSerialEngine#Any#,149

Before Change


  def reduce(self, execution_request):
    node_builder = self._scheduler.node_builder()
    for step_batch in self._scheduler.schedule(execution_request):
      for step, promise in step_batch:
        keyed_request, result = self._maybe_cache_get(step)
        if result is None:
          result = step(node_builder)
        self._maybe_cache_put(keyed_request, result)
        promise.success(result)


def _try_pickle(obj):
  try:
    pickle.dumps(obj, protocol=pickle.HIGHEST_PROTOCOL)
  except Exception as e:

After Change


        key, result = self._maybe_cache_get(entry, runnable)
        if result is None:
          try:
            result = Return(runnable.func(*runnable.args))
            self._maybe_cache_put(key, result)
          except Exception as e:
            result = Throw(e)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: pantsbuild/pants
Commit Name: 14759e1065e307c7760299670da30f64ffdbf783
Time: 2016-08-27
Author: stuhood@gmail.com
File Name: src/python/pants/engine/engine.py
Class Name: LocalSerialEngine
Method Name: reduce


Project Name: scikit-optimize/scikit-optimize
Commit Name: 4af750bec058da0cf5d4a3245a443549b9d7fd33
Time: 2016-04-05
Author: manojkumarsivaraj334@gmail.com
File Name: skopt/dummy_opt.py
Class Name:
Method Name: dummy_minimize


Project Name: scikit-image/scikit-image
Commit Name: 7ce950f6379ed53bc982e18132ec63d76f0cdfc5
Time: 2018-10-29
Author: mark.harfouche@gmail.com
File Name: skimage/measure/block.py
Class Name:
Method Name: block_reduce