Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| from decorator import decorator | |
| from line_profiler import LineProfiler | |
| @decorator | |
| def profile_each_line(func, *args, **kwargs): | |
| profiler = LineProfiler() | |
| profiled_func = profiler(func) | |
| try: | |
| profiled_func(*args, **kwargs) | |
| finally: |
Located in alphabetical order (not prefer)
Cab), also designed as a more modern replacement, written in Cgolang)