def is_method_call(node, method_name):
if not isinstance(node, nodes.Call):<EOL><INDENT>return False<EOL><DEDENT>if isinstance(node.node, nodes.Getattr):<EOL><INDENT>method = node.node.attr<EOL><DEDENT>elif isinstance(node.node, nodes.Name):<EOL><INDENT>method = node.node.name<EOL><DEDENT>elif isinstance(node.node, nodes.Getitem):<EOL><INDENT>method = node.node.arg.value<EOL><DEDENT>else:<EOL><INDENT>return False<EOL><DEDENT>if isinstance(method_name, (list, tuple)):<EOL><INDENT>return method in method_name<EOL><DEDENT>return method == method_name<EOL>
Returns True if `node` is a method call for `method_name`. `method_name`
can be either a string or an iterable of strings.