def get(keys):
  """Fetch the specific Model instance with the given key from the datastore.

  We support Key objects and string keys (we convert them to Key objects
  automatically).

  Args:
    keys: Key within datastore entity collection to find; or string key;
      or list of Keys or string keys.

    Returns:
      If a single key was given: a Model instance associated with key
      for if it exists in the datastore, otherwise None; if a list of
      keys was given: a list whose items are either a Model instance or
      None.
  """
  keys, multiple = datastore.NormalizeAndTypeCheckKeys(keys)
  try:
    entities = datastore.Get(keys)
  except datastore_errors.EntityNotFoundError:
    assert not multiple
    return None
  models = []
  for entity in entities:
    if entity is None:
      model = None
    else:
      cls1 = class_for_kind(entity.kind())
      model = cls1.from_entity(entity)
    models.append(model)
  if multiple:
    return models
  assert len(models) == 1
  return models[0]
dataset/ETHPy150Open CollabQ/CollabQ/.google_appengine/google/appengine/ext/db/__init__.py/get/original