def _check_self_assigning_variable(self, node):
    scope = node.scope()
    scope_locals = scope.locals
    rhs_names = []
    targets = node.targets
    if isinstance(targets[0], astroid.Tuple):
        if (len(targets) != 1):
            return
        targets = targets[0].elts
        if (len(targets) == 1):
            return
    if isinstance(node.value, astroid.Name):
        if (len(targets) != 1):
            return
        rhs_names = [node.value]
    elif isinstance(node.value, astroid.Tuple):
        rhs_count = len(node.value.elts)
        if ((len(targets) != rhs_count) or (rhs_count == 1)):
            return
        rhs_names = node.value.elts
    for (target, lhs_name) in zip(targets, rhs_names):
        if (not isinstance(lhs_name, astroid.Name)):
            continue
        if (not isinstance(target, astroid.AssignName)):
            continue
        if (isinstance(scope, astroid.ClassDef) and (target.name in scope_locals)):
            continue
        if (target.name == lhs_name.name):
            self.add_message('self-assigning-variable', args=(target.name,), node=target)
def _check_self_assigning_variable(self, node):
    scope = node.scope()
    scope_locals = scope.locals
    rhs_names = []
    targets = node.targets
    if isinstance(targets[0], astroid.Tuple):
        if (len(targets) != 1):
            return
        targets = targets[0].elts
        if (len(targets) == 1):
            return
    if isinstance(node.value, astroid.Name):
        if (len(targets) != 1):
            return
        rhs_names = [node.value]
    elif isinstance(node.value, astroid.Tuple):
        rhs_count = len(node.value.elts)
        if ((len(targets) != rhs_count) or (rhs_count == 1)):
            return
        rhs_names = node.value.elts
    for (target, lhs_name) in zip(targets, rhs_names):
        if (not isinstance(lhs_name, astroid.Name)):
            continue
        if (not isinstance(target, astroid.AssignName)):
            continue
        if (isinstance(scope, astroid.ClassDef) and (target.name in scope_locals)):
            continue
        if (target.name == lhs_name.name):
            self.add_message('self-assigning-variable', args=(target.name,), node=target)