mrocklin/graph — pull request #2 by mrocklin (2013-02-11 01:56:07+00:00)
Title: add `getfn` keyword to run

Could use some feedback on the best way to do this. This enables us to change the functions that are run

```Python
times = dict()
def profile(dag, var):
rawfn = dag[var]
def newfn(*inputs):
start = time.time()
output = rawfn(*inputs)
end = time.time()
times[var] = end - start
return output
return newfn

run(dag, outputs, getfn=profile, **inputs)

# times now has {var: time} information
```