def _get_from_nest(nest, path):
  """Return element from a dictionary-only nest using path specified as list.

  Args:
    nest: A nested dictionary.
    path: A list of strings specifying a nested element.
  Returns:
    An leaf or subnest of the input nest.
  """
  if not path or not nest:
    return nest
  return _get_from_nest(nest.get(path[0], None), path[1:])