def is_valid_object_id(value):
    """Validates BSON IDs using mongoengine's ObjectIdField field."""
    try:
        OBJECT_ID.validate(value)
        return True
    except __HOLE__:
        return False
dataset/ETHPy150Open jazzband/django-mongonaut/mongonaut/utils.py/is_valid_object_id