def _format_segment(tokens, strict=True, gpstype=LIGOTimeGPS):
try:<EOL><INDENT>start, end, dur = tokens<EOL><DEDENT>except ValueError:  <EOL><INDENT>return Segment(*map(gpstype, tokens))<EOL><DEDENT>seg = Segment(gpstype(start), gpstype(end))<EOL>if strict and not float(abs(seg)) == float(dur):<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format(seg, dur),<EOL>)<EOL><DEDENT>return seg<EOL>
Format a list of tokens parsed from an ASCII file into a segment.