def _check_reversed(self, node):
try:<EOL><INDENT>argument = utils.safe_infer(utils.get_argument_from_call(node, position=<NUM_LIT:0>))<EOL><DEDENT>except utils.NoSuchArgumentError:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>if argument is astroid.Uninferable:<EOL><INDENT>return<EOL><DEDENT>if argument is None:<EOL><INDENT>if isinstance(node.args[<NUM_LIT:0>], astroid.Call):<EOL><INDENT>try:<EOL><INDENT>func = next(node.args[<NUM_LIT:0>].func.infer())<EOL><DEDENT>except astroid.InferenceError:<EOL><INDENT>return<EOL><DEDENT>if getattr(<EOL>func, "<STR_LIT:name>", None<EOL>) == "<STR_LIT>" and utils.is_builtin_object(func):<EOL><INDENT>self.add_message("<STR_LIT>", node=node)<EOL><DEDENT><DEDENT>return<EOL><DEDENT>if isinstance(argument, (astroid.List, astroid.Tuple)):<EOL><INDENT>return<EOL><DEDENT>if isinstance(argument, astroid.Instance):<EOL><INDENT>if argument._proxied.name == "<STR_LIT>" and utils.is_builtin_object(<EOL>argument._proxied<EOL>):<EOL><INDENT>self.add_message("<STR_LIT>", node=node)<EOL>return<EOL><DEDENT>if any(<EOL>ancestor.name == "<STR_LIT>" and utils.is_builtin_object(ancestor)<EOL>for ancestor in argument._proxied.ancestors()<EOL>):<EOL><INDENT>try:<EOL><INDENT>argument.locals[REVERSED_PROTOCOL_METHOD]<EOL><DEDENT>except KeyError:<EOL><INDENT>self.add_message("<STR_LIT>", node=node)<EOL><DEDENT>return<EOL><DEDENT><DEDENT>if hasattr(argument, "<STR_LIT>"):<EOL><INDENT>for methods in REVERSED_METHODS:<EOL><INDENT>for meth in methods:<EOL><INDENT>try:<EOL><INDENT>argument.getattr(meth)<EOL><DEDENT>except astroid.NotFoundError:<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.add_message("<STR_LIT>", node=node)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.add_message("<STR_LIT>", node=node)<EOL><DEDENT><DEDENT>
check that the argument to `reversed` is a sequence