python-datamodel 0.8.13__cp313-cp313-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
datamodel/profiler.py ADDED
@@ -0,0 +1,21 @@
1
+ import cProfile
2
+ import functools
3
+ import pstats
4
+
5
+
6
+ def profile(func):
7
+
8
+ @functools.wraps(func)
9
+ def inner(*args, **kwargs):
10
+ profiler = cProfile.Profile()
11
+ profiler.enable()
12
+ try:
13
+ retval = func(*args, **kwargs)
14
+ finally:
15
+ profiler.disable()
16
+ with open('profile.out', 'w') as profile_file:
17
+ stats = pstats.Stats(profiler, stream=profile_file)
18
+ stats.print_stats()
19
+ return retval
20
+
21
+ return inner
datamodel/py.typed ADDED
File without changes