<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 noWorkflow
Step1:  Analysis
Dependency graph
Step2:  Prolog queries
Step3:  SQL queries
Step4:  ORM
<ASSISTANT_TASK:>
Python Code:
%load_ext noworkflow
%now_set_default graph.height=200
%%now_run -e Tracer
def f(x, y=3):
    "Calculate x!/(x - y)!"
    return x * f(x - 1, y - 1) if y else 1
a = 10
b = a - 2
c = f(b)
print(c)
Explanation: noWorkflow: capturing and analyzing provenance from Python scripts
João Felipe Nicolaci Pimentel
(Universidade Federal Fluminense)
https://github.com/gems-uff/noworkflow
Provenance
“Refers to the documented history of an art
object, or the documentation of processes
in a digital object’s life cycle”
[Moreau et al., 2008]
noWorkflow
Capture provenance from python scripts transparently (no changes required)
How to capture
Cmd line: now run script.py
Jupyter Notebook magic
End of explanation
trial = _
trial.dot
Explanation: Analysis
Dependency graph
End of explanation
%%now_prolog {trial.id}
var_name({trial.id}, Id, 'b'), slice({trial.id}, Id, Vars)
%%now_prolog
var_name({trial.id}, 2, Name)
Explanation: Prolog queries
End of explanation
%%now_sql
select count(id) from function_activation
where trial_id={trial.id}
Explanation: SQL queries
End of explanation
trial.duration_text
len(list(trial.activations))
Explanation: ORM
End of explanation
<END_TASK>