def dqsegdb_cascaded_query(result, deactivated=False,<EOL>active_indicates_ifo_badness=False,<EOL>**kwargs):
def cascaded_query(protocol, server, ifo, name, request, start, end):<EOL><INDENT>flag = [x for x in result if<EOL>x.rsplit('<STR_LIT::>', <NUM_LIT:1>)[<NUM_LIT:0>] == '<STR_LIT>' % (ifo, name)][<NUM_LIT:0>]<EOL>version = int(flag.split('<STR_LIT::>')[-<NUM_LIT:1>])<EOL>return (<EOL>{'<STR_LIT>': list(map(tuple, result[flag].known)),<EOL>'<STR_LIT>': list(map(tuple, result[flag].active)),<EOL>'<STR_LIT>': ifo,<EOL>'<STR_LIT:name>': '<STR_LIT>',<EOL>'<STR_LIT:version>': <NUM_LIT:1>},<EOL>[{'<STR_LIT>': ifo,<EOL>'<STR_LIT:name>': name,<EOL>'<STR_LIT:version>': version,<EOL>'<STR_LIT>': list(map(tuple, result[flag].known)),<EOL>'<STR_LIT>': list(map(tuple, result[flag].active)),<EOL>'<STR_LIT>': {},<EOL>'<STR_LIT>': kwargs}],<EOL>{},<EOL>)<EOL><DEDENT>return cascaded_query<EOL>
Build a mock of `dqsegdb.apicalls.dqsegdbCascadedQuery` for testing