def _parse_query_segments(args, func):
<EOL>if len(args) == <NUM_LIT:1> and isinstance(args[<NUM_LIT:0>], SegmentList):<EOL><INDENT>return args[<NUM_LIT:0>]<EOL><DEDENT>if len(args) == <NUM_LIT:1>:<EOL><INDENT>args = args[<NUM_LIT:0>]<EOL><DEDENT>try:<EOL><INDENT>start, end = args<EOL><DEDENT>except ValueError as exc:<EOL><INDENT>exc.args = ('<STR_LIT>'<EOL>'<STR_LIT>'.format(<EOL>func.__name__),)<EOL>raise<EOL><DEDENT>return SegmentList([Segment(to_gps(start), to_gps(end))])<EOL>
Parse *args for query_dqsegdb() or query_segdb()

    Returns a SegmentList in all cases