def get_related_manager_and_model(ctx: MethodContext) -> tuple[Instance, Instance, Instance] | None:
    """
    Returns a 3-tuple consisting of:
      1. A `ManyRelatedManager` instance
      2. The first type parameter (_To) instance of 1. when it's a model
      3. The second type parameter (_Through) instance of 1. when it's a model
    When encountering a `ManyRelatedManager` that has populated its 2 first type
    parameters with models. Otherwise `None` is returned.

    For example: if given a `ManyRelatedManager[A, B]` where `A` and `B` are models the
    following 3-tuple is returned: `(ManyRelatedManager[A, B], A, B)`.
    """
    default_return_type = get_proper_type(ctx.default_return_type)
    if (
        isinstance(default_return_type, Instance)
        and default_return_type.type.fullname == fullnames.MANY_RELATED_MANAGER
    ):
        # This is a call to '__get__' overload with a model instance of 'ManyToManyDescriptor'.
        # Returning a 'ManyRelatedManager'. Which we want to, just like Django, build from the
        # default manager of the related model.
        many_related_manager = default_return_type
        # Require first and second type argument of 'ManyRelatedManager' to be models
        if (
            len(many_related_manager.args) >= 2
            and isinstance((_To := get_proper_type(many_related_manager.args[0])), Instance)
            and helpers.is_model_type(_To.type)
            and isinstance((_Through := get_proper_type(many_related_manager.args[1])), Instance)
            and helpers.is_model_type(_Through.type)
        ):
            return many_related_manager, _To, _Through

    return None

    Returns a 3-tuple consisting of:
      1. A `ManyRelatedManager` instance
      2. The first type parameter (_To) instance of 1. when it's a model
      3. The second type parameter (_Through) instance of 1. when it's a model
    When encountering a `ManyRelatedManager` that has populated its 2 first type
    parameters with models. Otherwise `None` is returned.

    For example: if given a `ManyRelatedManager[A, B]` where `A` and `B` are models the
    following 3-tuple is returned: `(ManyRelatedManager[A, B], A, B)`.
    
mypy_django_plugin/transformers/manytomany.py