code: def _format_segment(tokens, strict=True, gpstype=LIGOTimeGPS):
      
      try:
          start, end, dur = tokens
      except ValueError:  # two-columns
          return Segment(*map(gpstype, tokens))
      seg = Segment(gpstype(start), gpstype(end))
      if strict and not float(abs(seg)) == float(dur):
          raise ValueError(
              "segment {0!r} has incorrect duration {1!r}".format(seg, dur),
          )
      return seg
docs: Format a list of tokens parsed from an ASCII file into a segment.