MCPcopy Index your code
hub / github.com/pythonprofilers/memory_profiler / disable_by_count

Method disable_by_count

memory_profiler.py:782–789  ·  view source on GitHub ↗

Disable the profiler if the number of disable requests matches the number of enable requests.

(self)

Source from the content-addressed store, hash-verified

780 self.enable_count += 1
781
782 def disable_by_count(self):
783 """ Disable the profiler if the number of disable requests matches the
784 number of enable requests.
785 """
786 if self.enable_count > 0:
787 self.enable_count -= 1
788 if self.enable_count == 0:
789 self.disable()
790
791 def trace_memory_usage(self, frame, event, arg):
792 """Callback for sys.settrace"""

Callers 4

_count_ctxmgrMethod · 0.95
runctxMethod · 0.95
__exit__Method · 0.95
test_nested.pyFile · 0.80

Calls 1

disableMethod · 0.95

Tested by

no test coverage detected