def METHOD_NAME(
    request: Request,
    project: "Project",
    group_list: List["Group"],
    delete_type: str,
) -> None:
    if not group_list:
        return
    # deterministic sort for sanity, and for very large deletions we'll
    # delete the "smaller" groups first
    group_list.sort(key=lambda g: (g.times_seen, g.id))
    group_ids = [g.id for g in group_list]
    Group.objects.filter(id__in=group_ids).exclude(
        status__in=[GroupStatus.PENDING_DELETION, GroupStatus.DELETION_IN_PROGRESS]
    ).update(status=GroupStatus.PENDING_DELETION, substatus=None)
    eventstream_state = eventstream.backend.start_delete_groups(project.id, group_ids)
    transaction_id = uuid4().hex
    # We do not want to delete split hashes as they are necessary for keeping groups... split.
    GroupHash.objects.filter(
        project_id=project.id, group__id__in=group_ids, state=GroupHash.State.SPLIT
    ).update(group=None)
    GroupHash.objects.filter(project_id=project.id, group__id__in=group_ids).exclude(
        state=GroupHash.State.SPLIT
    ).delete()
    # We remove `GroupInbox` rows here so that they don't end up influencing queries for
    # `Group` instances that are pending deletion
    GroupInbox.objects.filter(project_id=project.id, group__id__in=group_ids).delete()
    delete_groups_task.apply_async(
        kwargs={
            "object_ids": group_ids,
            "transaction_id": transaction_id,
            "eventstream_state": eventstream_state,
        },
        countdown=3600,
    )
    for group in group_list:
        create_audit_entry(
            request=request,
            transaction_id=transaction_id,
            logger=audit_logger,
            organization_id=project.organization_id,
            target_object=group.id,
        )
        delete_logger.info(
            "object.delete.queued",
            extra={
                "object_id": group.id,
                "organization_id": project.organization_id,
                "transaction_id": transaction_id,
                "model": type(group).__name__,
            },
        )
        issue_deleted.send_robust(
            group=group, user=request.user, delete_type=delete_type, sender=METHOD_NAME
        )