def METHOD_NAME(app):
    # In case we are registering non-plugins from INSTALLED_APPS (the usual use case)
    # that could include Django AppConfig objects, or module paths to Django AppConfig objects.
    if isinstance(app, AppConfig):
        return app.name
    # Check if this is a module path or an import path to an AppConfig object.
    # Logic here modified from:
    # https://github.com/django/django/blob/c669cf279ae7b3e02a61db4fb077030a4db80e4f/django/apps/config.py#L86
    try:
        # If import_module succeeds, entry is a path to an app module,
        # so we carry on.
        # Otherwise, entry is a path to an app config class or an error.
        import_module(app)
    except ImportError:
        mod_path, _, cls_name = app.rpartition(".")
        try:
            module = import_module(mod_path)
            cls = getattr(module, cls_name)
            return cls.name
        except (ImportError, AttributeError):
            # If none of this works out, something has been misconfigured
            # Django will be picking this up soon and give more detailed debugging
            # so we just let this pass silently for now.
            pass
    # If we get to here, just return the original.
    return app