def dqsegdb_query_times(result, deactivated=False,<EOL>active_indicates_ifo_badness=False, **kwargs):
def query_times(protocol, server, ifo, name, version, request, start, end):<EOL><INDENT>flag = '<STR_LIT>' % (ifo, name, version)<EOL>span = SegmentList([Segment(start, end)])<EOL>if flag not in result:<EOL><INDENT>raise HTTPError('<STR_LIT>', <NUM_LIT>, '<STR_LIT>', None, None)<EOL><DEDENT>return {<EOL>'<STR_LIT>': ifo,<EOL>'<STR_LIT:name>': name,<EOL>'<STR_LIT:version>': version,<EOL>'<STR_LIT>': list(map(tuple, result[flag].known & span)),<EOL>'<STR_LIT>': list(map(tuple, result[flag].active & span)),<EOL>'<STR_LIT>': {},<EOL>'<STR_LIT>': kwargs,<EOL>}, '<STR_LIT>'<EOL><DEDENT>return query_times<EOL>
Build a mock of `dqsegdb.apicalls.dqsegdbQueryTimes` for testing