def METHOD_NAME(search_path, root):
  """Validate that a root is valid."""
  if root is None:
    return True
  directory, filename, search_keys = _get_key_location(search_path, root)
  if not filename:
    # _get_key_location already validated that the directory exists, so the root
    # is valid.
    return True
  # Check that the yaml file and keys exist.
  yaml_path = os.path.join(directory, filename)
  return (_find_key_in_yaml_file(
      yaml_path, search_keys, root, value_is_relative_path=False) is not None)