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:

After Change


  An engine that runs tasks locally and serially in-process.

  def reduce(self, execution_request):
    generator = self._scheduler.schedule(execution_request)
    for runnable_batch in generator:
      completed = []
      for entry, runnable in runnable_batch:
        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)
        completed.append((entry, result))
      generator.send(completed)


def _try_pickle(obj):
  try:
    pickle.dumps(obj, protocol=pickle.HIGHEST_PROTOCOL)
  except Exception as 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: pantsbuild/pants
Commit Name: 14759e1065e307c7760299670da30f64ffdbf783
Time: 2016-08-27
Author: stuhood@gmail.com
File Name: src/python/pants/engine/engine.py
Class Name: ConcurrentEngine
Method Name: reduce


Project Name: keras-team/keras
Commit Name: d5fb5d1f15a94d43bb803be257342c613f882087
Time: 2015-12-22
Author: francois.chollet@gmail.com
File Name: keras/callbacks.py
Class Name: LearningRateScheduler
Method Name: on_epoch_begin