MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / run

Function run

02-array-seq/lispy/py3.10/lis.py:202–208  ·  view source on GitHub ↗
(source: str)

Source from the content-addressed store, hash-verified

200################ command-line interface
201
202def run(source: str) -> Any:
203 global_env = Environment({}, standard_env())
204 tokens = tokenize(source)
205 while tokens:
206 exp = read_from_tokens(tokens)
207 result = evaluate(exp, global_env)
208 return result
209
210def main(args: list[str]) -> None:
211 if len(args) == 1:

Callers 8

test_factorialFunction · 0.90
test_gcdFunction · 0.90
test_quicksortFunction · 0.90
test_newtonFunction · 0.90
test_closureFunction · 0.90
test_closure_with_changeFunction · 0.90
test_closure_averagerFunction · 0.90
mainFunction · 0.70

Calls 5

EnvironmentClass · 0.70
standard_envFunction · 0.70
tokenizeFunction · 0.70
read_from_tokensFunction · 0.70
evaluateFunction · 0.70

Tested by 7

test_factorialFunction · 0.72
test_gcdFunction · 0.72
test_quicksortFunction · 0.72
test_newtonFunction · 0.72
test_closureFunction · 0.72
test_closure_with_changeFunction · 0.72
test_closure_averagerFunction · 0.72