kenenet 1.0.3__py3-none-any.whl → 1.0.5__py3-none-any.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.
- kenenet/__init__.py +33 -1
- {kenenet-1.0.3.dist-info → kenenet-1.0.5.dist-info}/METADATA +1 -1
- kenenet-1.0.5.dist-info/RECORD +5 -0
- kenenet-1.0.3.dist-info/RECORD +0 -5
- {kenenet-1.0.3.dist-info → kenenet-1.0.5.dist-info}/WHEEL +0 -0
- {kenenet-1.0.3.dist-info → kenenet-1.0.5.dist-info}/top_level.txt +0 -0
kenenet/__init__.py
CHANGED
@@ -286,10 +286,38 @@ _block_timings = defaultdict(float)
|
|
286
286
|
_current_context = None
|
287
287
|
_line_start_time = None
|
288
288
|
_stack = []
|
289
|
-
_ignore_line = {'frame = inspect.currentframe().f_back', 'filename = frame.f_code.co_filename', 'if _current_context is None:', 'sys.settrace(None)', 'Function: currentframe', 'return sys._getframe(1) if hasattr(sys, "_getframe") else None'}
|
289
|
+
_ignore_line = {'frame = inspect.currentframe().f_back', 'filename = frame.f_code.co_filename', 'if _current_context is None:', 'sys.settrace(None)', 'Function: currentframe', 'return sys._getframe(1) if hasattr(sys, "_getframe") else None', ' Function: recurser', 'Function: <listcomp>', 'Function: here', 'Function: _array_repr_implementation', 'Function: wrapper', 'Function: array2string', 'Function: _array2string', 'Function: _formatArray', 'Function: _extendLine_pretty', 'Function: _extendLine', 'Function: __call__', 'Function: _var', 'Function: _std', 'Function: std', 'Function: _leading_trailing', 'Function: __init__'}
|
290
290
|
_seen_lines = set() # Track lines we've already processed
|
291
291
|
_current_function = None
|
292
292
|
_function_lines = defaultdict(set) # Track which lines belong to which function
|
293
|
+
_site_packages_dirs = [] # List to store site-packages directories
|
294
|
+
|
295
|
+
# Initialize site-packages directories
|
296
|
+
|
297
|
+
# Get site-packages directories from sys.path
|
298
|
+
for path in sys.path:
|
299
|
+
if 'site-packages' in path or 'dist-packages' in path:
|
300
|
+
_site_packages_dirs.append(path)
|
301
|
+
|
302
|
+
|
303
|
+
def _is_package_code(filename):
|
304
|
+
"""Check if the given filename is from an imported package."""
|
305
|
+
# Skip if it's in site-packages
|
306
|
+
for site_dir in _site_packages_dirs:
|
307
|
+
if filename.startswith(site_dir):
|
308
|
+
return True
|
309
|
+
|
310
|
+
# Skip if it's a built-in module
|
311
|
+
if '<' in filename and '>' in filename: # Handles '<frozen importlib._bootstrap>' etc.
|
312
|
+
return True
|
313
|
+
|
314
|
+
# Skip standard library modules
|
315
|
+
for path in sys.path:
|
316
|
+
if 'python' in path.lower() and os.path.isdir(path) and not path.endswith('site-packages'):
|
317
|
+
if filename.startswith(path):
|
318
|
+
return True
|
319
|
+
|
320
|
+
return False
|
293
321
|
|
294
322
|
|
295
323
|
def time_code(label=None):
|
@@ -313,6 +341,10 @@ def time_code(label=None):
|
|
313
341
|
def trace_function(frame, event, arg):
|
314
342
|
global _line_start_time, _stack, _seen_lines, _current_function, _function_lines
|
315
343
|
|
344
|
+
# Skip tracking for package code
|
345
|
+
if _is_package_code(frame.f_code.co_filename):
|
346
|
+
return trace_function
|
347
|
+
|
316
348
|
# Track function calls and returns
|
317
349
|
if event == 'call':
|
318
350
|
func_name = frame.f_code.co_name
|
@@ -0,0 +1,5 @@
|
|
1
|
+
kenenet/__init__.py,sha256=p2bl59OmW7OI5L0HPAcDYqDqigIik0Js4djFqRIDaVA,20517
|
2
|
+
kenenet-1.0.5.dist-info/METADATA,sha256=A3rWN_i3R21vkdykLlo_8VryFM497ZF16eS29uiARnQ,1693
|
3
|
+
kenenet-1.0.5.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
4
|
+
kenenet-1.0.5.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
|
5
|
+
kenenet-1.0.5.dist-info/RECORD,,
|
kenenet-1.0.3.dist-info/RECORD
DELETED
@@ -1,5 +0,0 @@
|
|
1
|
-
kenenet/__init__.py,sha256=TFgUSpmlHhk8DSDPJiP7sy-Rd8-rRxt2a7jfEhWiANA,19006
|
2
|
-
kenenet-1.0.3.dist-info/METADATA,sha256=C4jOWMNxXJMbfuoIcoZqmSC1vvrqiSHKc3Y3nrSLJRU,1693
|
3
|
-
kenenet-1.0.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
4
|
-
kenenet-1.0.3.dist-info/top_level.txt,sha256=gUsWXLrM0jF4b4nbYJZdksdFewIx_F3xOF-zER8fMuQ,8
|
5
|
-
kenenet-1.0.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|