@utils.check_messages('unnecessary-lambda')
def visit_lambda(self, node):
    'check whether or not the lambda is suspicious'
    if node.args.defaults:
        return
    call = node.body
    if (not isinstance(call, astroid.Call)):
        return
    if (isinstance(node.body.func, astroid.Attribute) and isinstance(node.body.func.expr, astroid.Call)):
        return
    call_site = astroid.arguments.CallSite.from_call(call)
    ordinary_args = list(node.args.args)
    new_call_args = list(self._filter_vararg(node, call.args))
    if node.args.kwarg:
        if self._has_variadic_argument(call.kwargs, node.args.kwarg):
            return
    if node.args.vararg:
        if self._has_variadic_argument(call.starargs, node.args.vararg):
            return
    elif call.starargs:
        return
    if call.keywords:
        lambda_kwargs = {keyword.name for keyword in node.args.defaults}
        if (len(lambda_kwargs) != len(call_site.keyword_arguments)):
            return
        if set(call_site.keyword_arguments).difference(lambda_kwargs):
            return
    if (len(ordinary_args) != len(new_call_args)):
        return
    for (arg, passed_arg) in zip(ordinary_args, new_call_args):
        if (not isinstance(passed_arg, astroid.Name)):
            return
        if (arg.name != passed_arg.name):
            return
    self.add_message('unnecessary-lambda', line=node.fromlineno, node=node)
check whether or not the lambda is suspicious
@utils.check_messages('unnecessary-lambda')
def visit_lambda(self, node):
    
    if node.args.defaults:
        return
    call = node.body
    if (not isinstance(call, astroid.Call)):
        return
    if (isinstance(node.body.func, astroid.Attribute) and isinstance(node.body.func.expr, astroid.Call)):
        return
    call_site = astroid.arguments.CallSite.from_call(call)
    ordinary_args = list(node.args.args)
    new_call_args = list(self._filter_vararg(node, call.args))
    if node.args.kwarg:
        if self._has_variadic_argument(call.kwargs, node.args.kwarg):
            return
    if node.args.vararg:
        if self._has_variadic_argument(call.starargs, node.args.vararg):
            return
    elif call.starargs:
        return
    if call.keywords:
        lambda_kwargs = {keyword.name for keyword in node.args.defaults}
        if (len(lambda_kwargs) != len(call_site.keyword_arguments)):
            return
        if set(call_site.keyword_arguments).difference(lambda_kwargs):
            return
    if (len(ordinary_args) != len(new_call_args)):
        return
    for (arg, passed_arg) in zip(ordinary_args, new_call_args):
        if (not isinstance(passed_arg, astroid.Name)):
            return
        if (arg.name != passed_arg.name):
            return
    self.add_message('unnecessary-lambda', line=node.fromlineno, node=node)