code: def pformat(self, prefix=()):
          '''
          Makes a pretty ASCII format of the data, suitable for
          displaying in a console or saving to a text file.
          Returns a list of lines.
          '''
          nan = float("nan")
  
          def sformat(segment, stat):
              FMT = "n={0}, mean={1}, p50/95={2}/{3}, max={4}"
              line_segs = [segment]
              for s in [stat]:
                  p = s.get_percentiles()
                  p50, p95 = p.get(0.50, nan), p.get(0.95, nan)
                  line_segs.append(FMT.format(s.n, s.mean, p50, p95, s.max))
              return '{0}: {1}'.format(*line_segs)
  
          lines = []
          for path in sorted(self.path_stats.keys()):
              lines.append('=====================')
              for seg, stat in zip(path, self.path_stats[path]):
                  lines.append(sformat(seg, stat))
          return linef pformat(self, prefix=()):
          '''
          Makes a pretty ASCII format of the data, suitable for
          displaying in a console or saving to a text file.
          Returns a list of lines.
          '''
          nan = float("nan")
  
          def sformat(segment, stat):
              FMT = "n={0}, mean={1}, p50/95={2}/{3}, max={4}"
              line_segs = [segment]
              for s in [stat]:
                  p = s.get_percentiles()
                  p50, p95 = p.get(0.50, nan), p.get(0.95, nan)
                  line_segs.append(FMT.format(s.n, s.mean, p50, p95, s.max))
              return '{0}: {1}'.format(*line_segs)
  
          lines = []
          for path in sorted(self.path_stats.keys()):
              lines.append('=====================')
              for seg, stat in zip(path, self.path_stats[path]):
                  lines.append(sformat(seg, stat))
          return lines
docs: Makes a pretty ASCII format of the data, suitable for
          displaying in a console or saving to a text file.
          Returns a list of lines.