def create_many_related_manager(self, model: Instance) -> None:
        """
        Creates a generic manager that subclasses both 'ManyRelatedManager' and the
        default manager of the given model. These are normally used on both models
        involved in a ManyToManyField.

        The manager classes are generic over a '_Through' model, meaning that they can
        be reused for multiple many to many relations.
        """
        if helpers.get_many_to_many_manager_info(self.api, to=model.type, derived_from="_default_manager") is not None:
            return

        default_manager_node = model.type.names.get("_default_manager")
        if default_manager_node is None:
            raise helpers.IncompleteDefnException()
        default_manager_type = get_proper_type(default_manager_node.type)
        if not isinstance(default_manager_type, Instance):
            return

        # Create a reusable generic subclass that is generic over a 'through' model,
        # explicitly declared it'd could have looked something like below
        #
        # class X(models.Model): ...
        # _Through = TypeVar("_Through", bound=models.Model)
        # class X_ManyRelatedManager(ManyRelatedManager[X, _Through], type(X._default_manager), Generic[_Through]): ...
        through_type_var = self.many_related_manager.defn.type_vars[1]
        assert isinstance(through_type_var, TypeVarType)
        generic_to_many_related_manager = Instance(self.many_related_manager, [model, through_type_var.copy_modified()])
        related_manager_info = helpers.add_new_class_for_module(
            module=self.api.modules[model.type.module_name],
            name=f"{model.type.name}_ManyRelatedManager",
            bases=[generic_to_many_related_manager, default_manager_type],
        )
        # Reuse the '_Through' `TypeVar` from `ManyRelatedManager` in our subclass
        related_manager_info.defn.type_vars = [through_type_var.copy_modified()]
        related_manager_info.add_type_vars()
        # Track the existence of our manager subclass, by tying it to the model it
        # operates on
        helpers.set_many_to_many_manager_info(
            to=model.type, derived_from="_default_manager", manager_info=related_manager_info
        )
        helpers.set_manager_to_model(related_manager_info, model.type)

        Creates a generic manager that subclasses both 'ManyRelatedManager' and the
        default manager of the given model. These are normally used on both models
        involved in a ManyToManyField.

        The manager classes are generic over a '_Through' model, meaning that they can
        be reused for multiple many to many relations.
        
mypy_django_plugin/transformers/models.py