code: def _line_format(line):
      
      for pat in (FOUR_COL_REGEX, THREE_COL_REGEX, TWO_COL_REGEX):
          if pat.match(line):
              return pat
      raise ValueError("unable to parse segment from line {!r}".format(line))
docs: Determine the column format pattern for a line in an ASCII segment file.