def update(self, old):
if not old or not old.is_minimally_valid() or not old.id:<EOL><INDENT>return self.query_sequence(old)<EOL><DEDENT>retval = self._fdb_error_handler_wrapper(fdb.query_id, old.seq, old.id)<EOL>if retval is None: <EOL><INDENT>return old, False<EOL><DEDENT>else:<EOL><INDENT>status, data = retval<EOL><DEDENT>if status is fdb.FDBStatus.CompositeFullyFactored:<EOL><INDENT>return self.query_sequence(old)<EOL><DEDENT>elif status is fdb.FDBStatus.CompositePartiallyFactored: <EOL><INDENT>factors, cofactor = data<EOL>if factors != old.factors:<EOL><INDENT>old.factors = factors<EOL>old.cofactor = cofactor<EOL>old.process_no_progress(partial=True) <EOL><DEDENT>else:<EOL><INDENT>old.process_no_progress()<EOL><DEDENT><DEDENT>elif status is fdb.FDBStatus.Prime:<EOL><INDENT>_logger.error(f"<STR_LIT>")<EOL>old.process_no_progress()<EOL><DEDENT>else:<EOL><INDENT>_logger.error(f"<STR_LIT>")<EOL>return old, False<EOL><DEDENT>return old, True<EOL>
Returns (old-or-new ali object, successful_update)