MCPcopy Index your code
hub / github.com/stumpy-dev/stumpy / _get_fastmath_value

Function _get_fastmath_value

stumpy/__init__.py:66–78  ·  view source on GitHub ↗
(module_name, func_name)

Source from the content-addressed store, hash-verified

64
65
66def _get_fastmath_value(module_name, func_name): # pragma: no cover
67 fname = module_name + ".py"
68 fname = pathlib.Path(__file__).parent / fname
69 with open(fname, "r", encoding="utf-8") as f:
70 src = f.read()
71 tree = ast.parse(src)
72 for node in ast.walk(tree):
73 if isinstance(node, ast.FunctionDef) and node.name == func_name:
74 for dec in node.decorator_list:
75 for kw in dec.keywords:
76 if kw.arg == "fastmath":
77 fastmath_flag = ast.get_source_segment(src, kw.value)
78 return eval(fastmath_flag)
79
80
81njit_funcs = cache.get_njit_funcs()

Callers 2

test_get_fastmath_valueFunction · 0.90
__init__.pyFile · 0.85

Calls

no outgoing calls

Tested by 1

test_get_fastmath_valueFunction · 0.72