def _validate_project(project, parent):
    if parent is None:
        if project is None:
            raise ValueError("A Key must have a project set.")

    return project
Ensure the project is set appropriately.
dataset/ETHPy150Open GoogleCloudPlatform/gcloud-python/gcloud/datastore/key.py/_validate_project