def is_complete_v1_key(v1_key):
  """Returns True if a key specifies an ID or name, False otherwise.

  Args:
    v1_key: an googledatastore.Key

  Returns:
    True if the key specifies an ID or name, False otherwise.
  """
  assert len(v1_key.path) >= 1
  last_element = v1_key.path[len(v1_key.path) - 1]
  return last_element.WhichOneof('id_type') is not None
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-compat/exported_appengine_sdk/google/appengine/datastore/datastore_pbs.py/is_complete_v1_key/original