def METHOD_NAME(
    database: Database,
    delta_description: str,
    documents: Sequence[dict],
    uuids: list[ItemId] | None = None,
    **extra_attributes,
) -> None:
    """Prepare the documents for insertion in the database by removing any ids and setting the extra attributes."""
    now = iso_timestamp()
    user = sessions.find_user(database)
    username = user.name() or "An operator"
    # Don't use str.format because there may be curly braces in the delta description, e.g. due to regular expressions:
    description = delta_description.replace("{user}", username, 1)
    for document in documents:
        if "_id" in document:
            del document["_id"]
        document["timestamp"] = now
        document["delta"] = {"description": description, "email": user.email, "uuids": sorted(set(uuids or []))}
        for key, value in extra_attributes.items():
            document[key] = value