@utils.check_messages('init-is-generator', 'return-in-init', 'function-redefined', 'return-arg-in-generator', 'duplicate-argument-name', 'nonlocal-and-global', 'used-prior-global-declaration')
def visit_functiondef(self, node):
    self._check_nonlocal_and_global(node)
    self._check_name_used_prior_global(node)
    if ((not redefined_by_decorator(node)) and (not utils.is_registered_in_singledispatch_function(node))):
        self._check_redefinition(((node.is_method() and 'method') or 'function'), node)
    returns = node.nodes_of_class(astroid.Return, skip_klass=(astroid.FunctionDef, astroid.ClassDef))
    if (node.is_method() and (node.name == '__init__')):
        if node.is_generator():
            self.add_message('init-is-generator', node=node)
        else:
            values = [r.value for r in returns]
            if any((v for v in values if (not utils.is_none(v)))):
                self.add_message('return-in-init', node=node)
    arg_clusters = collections.defaultdict(list)
    arguments = filter(None, [node.args.args, node.args.kwonlyargs])
    for arg in itertools.chain.from_iterable(arguments):
        arg_clusters[arg.name].append(arg)
    for argument_duplicates in arg_clusters.values():
        if (len(argument_duplicates) != 1):
            for argument in argument_duplicates:
                self.add_message('duplicate-argument-name', line=argument.lineno, node=argument, args=(argument.name,))
@utils.check_messages('init-is-generator', 'return-in-init', 'function-redefined', 'return-arg-in-generator', 'duplicate-argument-name', 'nonlocal-and-global', 'used-prior-global-declaration')
def visit_functiondef(self, node):
    self._check_nonlocal_and_global(node)
    self._check_name_used_prior_global(node)
    if ((not redefined_by_decorator(node)) and (not utils.is_registered_in_singledispatch_function(node))):
        self._check_redefinition(((node.is_method() and 'method') or 'function'), node)
    returns = node.nodes_of_class(astroid.Return, skip_klass=(astroid.FunctionDef, astroid.ClassDef))
    if (node.is_method() and (node.name == '__init__')):
        if node.is_generator():
            self.add_message('init-is-generator', node=node)
        else:
            values = [r.value for r in returns]
            if any((v for v in values if (not utils.is_none(v)))):
                self.add_message('return-in-init', node=node)
    arg_clusters = collections.defaultdict(list)
    arguments = filter(None, [node.args.args, node.args.kwonlyargs])
    for arg in itertools.chain.from_iterable(arguments):
        arg_clusters[arg.name].append(arg)
    for argument_duplicates in arg_clusters.values():
        if (len(argument_duplicates) != 1):
            for argument in argument_duplicates:
                self.add_message('duplicate-argument-name', line=argument.lineno, node=argument, args=(argument.name,))