docs: def gen_posix(output, is_bytes=False, append=False, prefix=""):
      """Generate the bytes posix table and write out to file."""
  
      posix_table = {}
  
      # `Alnum: [a-zA-Z0-9]`
      s = set([x for x in range(0x30, 0x39 + 1)])
      s |= set([x for x in range(0x41, 0x5a + 1)])
      s |= set([x for x in range(0x61, 0x7a + 1)])
      posix_table["alnum"] = list(s)
  
      # `Alpha: [a-zA-Z]`
      s = set([x for x in range(0x41, 0x5a)])
      s |= set([x for x in range(0x61, 0x7a)])
      posix_table["alpha"] = list(s)
  
      # `ASCII: [\x00-\x7F]`
      s = set([x for x in range(0, 0x7F + 1)])
      posix_table["ascii"] = list(s)
  
      # `Blank: [ \t]`
      s = set([0x20, 0x09])
      posix_table["blank"] = list(s)
  
      # `Cntrl: [\x00-\x1F\x7F]`
      s = set([x for x in range(0, 0x1F + 1)] + [0x7F])
      posix_table["cntrl"] = list(s)
  
      # `Digit: [0-9]`
      s = set([x for x in range(0x30, 0x39 + 1)])
      posix_table["digit"] = list(s)
  
      # `Graph: [\x21-\x7E]`
      s = set([x for x in range(0x21, 0x7E + 1)])
      posix_table["graph"] = list(s)
  
      # `Lower: [a-z]`
      s = set([x for x in range(0x61, 0x7a + 1)])
      posix_table["lower"] = list(s)
  
      # `Print: [\x20-\x7E]`
      s = set([x for x in range(0x20, 0x7E + 1)])
      posix_table["print"] = list(s)
  
      # `Punct: [!\"\#$%&'()*+,\-./:;<=>?@\[\\\]^_`{|}~]`
      s = set([x for x in range(0x21, 0x2f + 1)])
      s |= set([x for x in range(0x3a, 0x40 + 1)])
      s |= set([x for x in range(0x5b, 0x60 + 1)])
      s |= set([x for x in range(0x7b, 0x7e + 1)])
      posix_table["punct"] = list(s)
  
      # `Space: [ \t\r\n\v\f]`
      s = set([x for x in range(0x09, 0x0d + 1)] + [0x20])
      posix_table["space"] = list(s)
  
      # `Upper: [A-Z]`
      s = set([x for x in range(0x41, 0x5a + 1)])
      posix_table["upper"] = list(s)
  
      # `XDigit: [A-Fa-f0-9]`
      s = set([x for x in range(0x30, 0x39 + 1)])
      s |= set([x for x in range(0x41, 0x46 + 1)])
      s |= set([x for x in range(0x61, 0x66 + 1)])
      posix_table["xdigit"] = list(s)
  
      # Convert characters values to ranges
      char2range(posix_table, is_bytes=is_bytes)
  
      with codecs.open(output, 'a' if append else 'w', 'utf-8') as f:
          if not append:
              f.write(HEADER)
          # Write out the Unicode properties
          f.write('%s_posix_properties = {\n' % prefix)
          count = len(posix_table) - 1
          i = 0
          for k1, v1 in sorted(posix_table.items()):
              f.write('    "%s": "%s"' % (k1, v1))
              if i == count:
                  f.write('\n}\n')
              else:
                  f.write(',\n')
              i += 1