docs: def pprint_sequence(sequence, annotations=None, block_length=10,
                      blocks_per_line=6, format=PlaintextFormat):
      """
      Pretty-print sequence for use with a monospace font.
  
          >>> sequence = 'MIMANQPLWLDSEVEMNHYQQSHIKSKSPYFPEDKHICWIKIFKAFGT' * 4
          >>> print pprint_sequence(sequence, format=PlaintextFormat)
            1  MIMANQPLWL DSEVEMNHYQ QSHIKSKSPY FPEDKHICWI KIFKAFGTMI MANQPLWLDS
           61  EVEMNHYQQS HIKSKSPYFP EDKHICWIKI FKAFGTMIMA NQPLWLDSEV EMNHYQQSHI
          121  KSKSPYFPED KHICWIKIFK AFGTMIMANQ PLWLDSEVEM NHYQQSHIKS KSPYFPEDKH
          181  ICWIKIFKAF GT
  
      :arg sequence: Sequence to pretty-print.
      :type sequence: str or any sliceable yielding slices representable as
          strings.
      :arg annotations: For each annotation level, a list of (`start`, `stop`)
          pairs defining an annotated region.
      :type annotations: list
      :arg block_length: Length of space-separated blocks.
      :type block_length: int
      :arg blocks_per_line: Number of blocks per line.
      :type blocks_per_line: int
      :arg format: Output format to use for pretty-printing. Some formats are
          pre-defined as :data:`HtmlFormat`, :data:`AnsiFormat`, and
          :data:`PlaintextFormat`.
      :type format: :class:`Format`
  
      :return: Pretty-printed version of `sequence`.
      :rtype: str
  
      All regions (`start`, `stop`) are defined as in slicing notation, so
      zero-based and `stop` is not included.
  
      The `annotations` argument is a list of annotations. An annotation is a
      list of regions as (`start`, `stop`) tuples. The level of each annotation
      is its index in `annotations`.
  
      Annotation regions can overlap (overlap within one level is ignored) and
      do not need to be sorted.
  
      The number of annotation levels supported depends on `format`.
      :data:`HtmlFormat` supports 10 levels, :data:`AnsiFormat` supports 3
      levels and annotations are ignored completely with
      :data:`PlaintextFormat`.
      """
      annotations = annotations or []
  
      partitioning = partition_range(len(sequence), annotations)
  
      # The maximum length for positions is the 10_log of the length of the
      # sequence.
      margin = int(math.floor(math.log(max(len(sequence), 1), 10))
                   + 1) + len(format.margin[0])
      result = (format.margin[0] + '1').rjust(margin) + format.margin[1] + ' '
  
      for p in range(0, len(sequence), block_length):
          # Partitioning of the block starting at position p.
          block = [(max(start, p), min(stop, p + block_length), levels)
                   for start, stop, levels in partitioning
                   if start < p + block_length and stop > p]
  
          result += ' '
          for start, stop, levels in block:
              delimiters = [(left, right) for level, (left, right)
                            in enumerate(format.annotations) if level in levels]
              result += (''.join(left for left, right in reversed(delimiters)) +
                         str(sequence[start:stop]) +
                         ''.join(right for left, right in delimiters))
  
          if (not (p + block_length) % (block_length * blocks_per_line) and
              p + block_length < len(sequence)):
              result += ('\n' + (format.margin[0] +
                                 str(p + block_length + 1)).rjust(margin) +
                         format.margin[1] + ' ')
  
      return result