def collect_field_asts_and_defs(self, parent_type, selection_set, visited_fragment_names=None, ast_and_defs=None):
        if visited_fragment_names is None:
            visited_fragment_names = set()

        if ast_and_defs is None:
            # An ordered dictionary is required, otherwise the error message will be out of order.
            # We need to preserve the order that the item was inserted into the dict, as that will dictate
            # in which order the reasons in the error message should show.
            # Otherwise, the error messages will be inconsistently ordered for the same AST.
            # And this can make it so that tests fail half the time, and fool a user into thinking that
            # the errors are different, when in-fact they are the same, just that the ordering of the reasons differ.
            ast_and_defs = DefaultOrderedDict(list)

        for selection in selection_set.selections:
            if isinstance(selection, ast.Field):
                field_name = selection.name.value
                field_def = None
                if isinstance(parent_type, (GraphQLObjectType, GraphQLInterfaceType)):
                    field_def = parent_type.get_fields().get(field_name)

                response_name = selection.alias.value if selection.alias else field_name
                ast_and_defs[response_name].append((parent_type, selection, field_def))

            elif isinstance(selection, ast.InlineFragment):
                type_condition = selection.type_condition
                inline_fragment_type = \
                    type_from_ast(self.context.get_schema(), type_condition) \
                    if type_condition else parent_type

                self.collect_field_asts_and_defs(
                    inline_fragment_type,
                    selection.selection_set,
                    visited_fragment_names,
                    ast_and_defs
                )

            elif isinstance(selection, ast.FragmentSpread):
                fragment_name = selection.name.value
                if visited_fragment_names in fragment_name:
                    continue

                visited_fragment_names.add(fragment_name)
                fragment = self.context.get_fragment(fragment_name)

                if not fragment:
                    continue

                self.collect_field_asts_and_defs(
                    type_from_ast(self.context.get_schema(), fragment.type_condition),
                    fragment.selection_set,
                    visited_fragment_names,
                    ast_and_defs
                )

        return ast_and_defs
dataset/ETHPy150Open graphql-python/graphql-core/graphql/core/validation/rules/overlapping_fields_can_be_merged.py/OverlappingFieldsCanBeMerged.collect_field_asts_and_defs/swapped operands of `in`