Created
October 18, 2022 20:05
-
-
Save galenseilis/79299b2a0985cf9b492e0168c5358772 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pycallgraph2 import PyCallGraph | |
from pycallgraph2 import Config | |
from pycallgraph2 import GlobbingFilter | |
from pycallgraph2.output import GraphvizOutput | |
f=lambda p,r,c=0:(q:=[c:=b+c*r for b in p])!=c==0and-~f(q[:-1],r) | |
x = ([1, -12, 60, -160, 240, -192, 64, 0], 2) | |
config = Config() | |
config.trace_filter = GlobbingFilter(exclude=[ | |
'pycallgraph2.*' | |
]) | |
with PyCallGraph(output=GraphvizOutput(), config=config): | |
f(*x) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: