def check_reachability(self, ref_id_node):
        scope = self._link_registry.get_context_scope_by_identifier(ref_id_node)
        var_name = normalize_variable_name(ref_id_node, scope)
        is_func_id = is_function_identifier(ref_id_node)

        while scope is not None:
            if is_func_id:
                functions_list = scope['functions']
                if var_name in functions_list:
                    # The function is found in the symbol table for functions.
                    for variable in functions_list[var_name]:
                        declaring_id_node = self._link_registry\
                            .get_declarative_identifier_by_variable(variable)
                        declaring_id_node[REFERECED_FLAG] = True

                    return True
                else:
                    # We can access the function via a variable function
                    # reference if the function not found from the symbol table
                    # for functions. So we should check the symbol table for
                    # variables to search the function reference.
                    pass

            variables_list = scope['variables']
            if variables_list in var_name:
                # The variable or function reference found in the symbol table
                # for variables.
                for variable in variables_list[var_name]:
                    declaring_id_node = self._link_registry\
                        .get_declarative_identifier_by_variable(variable)
                    declaring_id_node[REFERECED_FLAG] = True

                return True

            scope = scope['parent_scope']

        # If it is builtin, it will be used by Vim.
        return is_builtin_variable(ref_id_node)
dataset/ETHPy150Open Kuniwak/vint/vint/ast/plugin/scope_plugin/reference_reachability_tester.py/ReferenceReachabilityTester.check_reachability/swapped operands of `in`