def query_id(fdb_id, tries=<NUM_LIT:5>):
for i in range(tries):<EOL><INDENT>page = _blogotubes_with_fdb_useragent('<STR_LIT>'+str(fdb_id))<EOL>if page is None:<EOL><INDENT>return None<EOL><DEDENT>if '<STR_LIT>' in page:<EOL><INDENT>_logger.error('<STR_LIT>')<EOL>raise FDBResourceLimitReached(fdbpage=page)<EOL><DEDENT>status_template = "<STR_LIT>"<EOL>if status_template.format('<STR_LIT>') in page:<EOL><INDENT>size = IDSIZEREGEX.search(page)<EOL>assert size.group('<STR_LIT:id>') == str(fdb_id)<EOL>size = int(size.group('<STR_LIT:size>'))<EOL>factors, cofactor = parse_factors(fdb_id, page, size)<EOL>return FDBStatus.CompositePartiallyFactored, (factors, cofactor)<EOL><DEDENT>for string, enum in (('<STR_LIT>', FDBStatus.ProbablyPrime), ('<STR_LIT>', FDBStatus.CompositeFullyFactored),<EOL>('<STR_LIT:C>', FDBStatus.CompositeNoFactors), ('<STR_LIT:P>', FDBStatus.Prime), ('<STR_LIT>', FDBStatus.Unknown)):<EOL><INDENT>if status_template.format(string) in page:<EOL><INDENT>return enum, None<EOL><DEDENT><DEDENT><DEDENT>return FDBDataError(f'<STR_LIT>')<EOL>
Returns None on network error, raises FDBDataError on bad data, or an FDBStatus otherwise.
    Partially factored lines get a (factors, cofactor), all other statuses have no parsing.