docs: def add_format_info(matrix, version, error, mask_pattern):
      """\
      Adds the format information into the provided matrix.
  
      ISO/IEC 18004:2015(E) -- 7.9 Format information (page 55)
      ISO/IEC 18004:2015(E) -- 7.9.1 QR Code symbols
      ISO/IEC 18004:2015(E) -- 7.9.2 Micro QR Code symbols
  
      :param matrix: The matrix.
      :param int version: Version constant
      :param int error: Error level constant.
      :param int mask_pattern: Mask pattern number.
      """
      # 14: most significant bit
      #  0: least significant bit
      #
      # QR Code format info:                                          Micro QR format info
      # col 0                col 7              col matrix[-1]      col 1
      #                        0                       |               |                [ ]
      #                        1                                                         0
      #                        2                                                         1
      #                        3                                                         2
      #                        4                                                         3
      #                        5                                                         4
      #                       [ ]                                                        5
      #                        6                                                         6
      # 14 13 12 11 10 9 [ ] 8 7    ...  7 6 5 4 3 2 1 0              14 13 12 11 10 9 8 7
      #
      # ...
      #                       [ ] (dark module)
      #                        8
      #                        9
      #                       10
      #                       11
      #                       12
      #                       13
      #                       14
      is_micro = version < 1
      format_info = calc_format_info(version, error, mask_pattern)
      offset = int(is_micro)
      for i in range(8):
          bit = (format_info >> i) & 0x01
          if i == 6 and not is_micro:  # Timing pattern
              offset += 1
          # vertical row, upper left corner
          matrix[i + offset][8] = bit
          if not is_micro:
              # horizontal row, upper right corner
              matrix[8][-1 - i] = bit
      offset = int(is_micro)
      for i in range(8):
          bit = (format_info >> (14 - i)) & 0x01
          if i == 6 and not is_micro:  # Timing pattern
              offset = 1
          # horizontal row, upper left corner
          matrix[8][i + offset] = bit
          if not is_micro:
              # vertical row, bottom left corner
              matrix[-1 - i][8] = bit
      if not is_micro:
          # Dark module
          matrix[-8][8] = 0x1