def METHOD_NAME(document: Dict, projection: Projection):
    """
    Apply a Mongo-style projection to a document and return it.
    :param document: the document to project
    :param projection: the projection to apply
    :return: the projected document
    """
    if isinstance(projection, (list, tuple)):
        if "_id" not in projection:
            projection.append("_id")
        return {key: document[key] for key in document if key in projection}
    if not isinstance(projection, dict):
        raise TypeError(f"Invalid type for projection: {type(projection)}")
    if projection == {"_id": False}:
        return {key: document[key] for key in document if key != "_id"}
    if all(value is False for value in projection.values()):
        return {key: document[key] for key in document if key not in projection}
    if "_id" not in projection:
        projection["_id"] = True
    return {key: document[key] for key in document if projection.get(key, False)}