def resolve_many_to_many_arguments(self, call: CallExpr, /, context: Context) -> M2MArguments | None:
        """
        Inspect a 'ManyToManyField(...)' call to collect argument data on any 'to' and
        'through' arguments.
        """
        look_for: dict[str, Expression | None] = {"to": None, "through": None}
        # Look for 'to', being declared as the first positional argument
        if call.arg_kinds[0].is_positional():
            look_for["to"] = call.args[0]
        # Look for 'through', being declared as the sixth positional argument.
        if len(call.args) > 5 and call.arg_kinds[5].is_positional():
            look_for["through"] = call.args[5]

        # Sort out if any of the expected arguments was provided as keyword arguments
        for arg_expr, _arg_kind, arg_name in zip(call.args, call.arg_kinds, call.arg_names, strict=False):
            if arg_name in look_for and look_for[arg_name] is None:
                look_for[arg_name] = arg_expr

        # 'to' is a required argument of 'ManyToManyField()', we can't do anything if it's not provided
        to_arg = look_for["to"]
        if to_arg is None:
            return None

        # Resolve the type of the 'to' argument expression
        to_model = helpers.get_model_from_expression(
            to_arg, self_model=self.model_classdef.info, api=self.api, django_context=self.django_context
        )
        if to_model is None:
            return None
        to = M2MTo(
            arg=to_arg,
            model=to_model,
            self=to_model.type == self.model_classdef.info,
        )

        # Resolve the type of the 'through' argument expression
        through_arg = look_for["through"]
        through = None
        if through_arg is not None:
            through_model = helpers.get_model_from_expression(
                through_arg, self_model=self.model_classdef.info, api=self.api, django_context=self.django_context
            )
            if through_model is not None:
                through = M2MThrough(arg=through_arg, model=through_model)

        return M2MArguments(to=to, through=through)

        Inspect a 'ManyToManyField(...)' call to collect argument data on any 'to' and
        'through' arguments.
        
mypy_django_plugin/transformers/models.py