def from_segwizard(source, gpstype=LIGOTimeGPS, strict=True):
<EOL>if isinstance(source, string_types):<EOL><INDENT>with open(source, '<STR_LIT:r>') as fobj:<EOL><INDENT>return from_segwizard(fobj, gpstype=gpstype, strict=strict)<EOL><DEDENT><DEDENT>out = SegmentList()<EOL>fmt_pat = None<EOL>for line in source:<EOL><INDENT>if line.startswith(('<STR_LIT:#>', '<STR_LIT:;>')):  <EOL><INDENT>continue<EOL><DEDENT>if fmt_pat is None:<EOL><INDENT>fmt_pat = _line_format(line)<EOL><DEDENT>tokens, = fmt_pat.findall(line)<EOL>out.append(_format_segment(tokens[-<NUM_LIT:3>:], gpstype=gpstype,<EOL>strict=strict))<EOL><DEDENT>return out<EOL>
Read segments from a segwizard format file into a `SegmentList`

    Parameters
    ----------
    source : `file`, `str`
        An open file, or file path, from which to read

    gpstype : `type`, optional
        The numeric type to which to cast times (from `str`) when reading.

    strict : `bool`, optional
        Check that recorded duration matches ``end-start`` for all segments;
        only used when reading from a 3+-column file.

    Returns
    -------
    segments : `~gwpy.segments.SegmentList`
        The list of segments as parsed from the file.

    Notes
    -----
    This method is adapted from original code written by Kipp Cannon and
    distributed under GPLv3.