def query_item(self, key, abis):
try:<EOL><INDENT>key = int(key)<EOL>field = '<STR_LIT>'<EOL><DEDENT>except ValueError:<EOL><INDENT>try:<EOL><INDENT>key = int(key, <NUM_LIT:16>)<EOL>field = '<STR_LIT>'<EOL><DEDENT>except ValueError:<EOL><INDENT>field = '<STR_LIT:name>'<EOL><DEDENT><DEDENT>arg = and_(getattr(Item, field) == key,<EOL>or_(Item.abi == abi for abi in abis))<EOL>return self.session.query(Item).filter(arg).all()<EOL>
Query items based on system call number or name.