MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / load_stats

Method load_stats

tools/python-3.11.9-amd64/Lib/pstats.py:137–157  ·  view source on GitHub ↗
(self, arg)

Source from the content-addressed store, hash-verified

135 raise
136
137 def load_stats(self, arg):
138 if arg is None:
139 self.stats = {}
140 return
141 elif isinstance(arg, str):
142 with open(arg, 'rb') as f:
143 self.stats = marshal.load(f)
144 try:
145 file_stats = os.stat(arg)
146 arg = time.ctime(file_stats.st_mtime) + " " + arg
147 except: # in case this is not unix
148 pass
149 self.files = [arg]
150 elif hasattr(arg, 'create_stats'):
151 arg.create_stats()
152 self.stats = arg.stats
153 arg.stats = {}
154 if not self.stats:
155 raise TypeError("Cannot create or construct a %r object from %r"
156 % (self.__class__, arg))
157 return
158
159 def get_top_level_stats(self):
160 for func, (cc, nc, tt, ct, callers) in self.stats.items():

Callers 1

initMethod · 0.95

Calls 5

openFunction · 0.70
loadMethod · 0.45
statMethod · 0.45
ctimeMethod · 0.45
create_statsMethod · 0.45

Tested by

no test coverage detected