MCPcopy Index your code
hub / github.com/ipython/ipython / __str__

Method __str__

IPython/core/magics/execution.py:114–130  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

112 return (math.fsum([(x - mean) ** 2 for x in self.timings]) / len(self.timings)) ** 0.5
113
114 def __str__(self):
115 pm = '+-'
116 if hasattr(sys.stdout, 'encoding') and sys.stdout.encoding:
117 try:
118 "\xb1".encode(sys.stdout.encoding)
119 pm = "\xb1"
120 except:
121 pass
122 return "{mean} {pm} {std} per loop (mean {pm} std. dev. of {runs} run{run_plural}, {loops:,} loop{loop_plural} each)".format(
123 pm=pm,
124 runs=self.repeat,
125 loops=self.loops,
126 loop_plural="" if self.loops == 1 else "s",
127 run_plural="" if self.repeat == 1 else "s",
128 mean=_format_time(self.average, self._precision),
129 std=_format_time(self.stdev, self._precision),
130 )
131
132 def _repr_pretty_(self, p , cycle):
133 unic = self.__str__()

Callers 1

_repr_pretty_Method · 0.95

Calls 2

_format_timeFunction · 0.85
formatMethod · 0.45

Tested by

no test coverage detected