def METHOD_NAME(self, request, view):
    try:
        return getattr(view, "required_alternate_scopes")
    except AttributeError:
        raise ImproperlyConfigured(
            "TokenMatchesOASRequirements requires the view to"
            " define the required_alternate_scopes attribute"
        )