def METHOD_NAME(
    notification_settings: Iterable[Any],
) -> tuple[Mapping[int, Any], Mapping[int, Any]]:
    """Prefetch a list of Project or Organization objects for the Serializer."""
    from sentry.models.organization import Organization
    from sentry.models.project import Project
    project_ids = []
    organization_ids = []
    for notification_setting in notification_settings:
        if notification_setting.scope_type == NotificationScopeType.PROJECT.value:
            project_ids.append(notification_setting.scope_identifier)
        if notification_setting.scope_type == NotificationScopeType.ORGANIZATION.value:
            organization_ids.append(notification_setting.scope_identifier)
    projects = Project.objects.filter(id__in=project_ids)
    organizations = Organization.objects.filter(id__in=organization_ids)
    project_mapping = {project.id: project for project in projects}
    organization_mapping = {organization.id: organization for organization in organizations}
    return project_mapping, organization_mapping