def _getFolderIndex(folderChildren, name):
  """Get the index of a subfolder based on its name.
    folderChildren -- Dictionary specifying children of the folder.
    name -- Name of the folder to look for.
    Returns the index of the folder in the dictionary."""
  folders = folderChildren["folders"]
  index = -1
  for folder in folders:
    index = index + 1
    if folder["name"] == name:
      return index
  return -1