docs: def load_maps(maps_dir):
      """
      Load all xml map sources from a given directory.
  
      Args:
          maps_dir: path to directory to search for maps
  
      Returns:
          dict of MapSource:
  
      """
      maps_dir = os.path.abspath(maps_dir)
      maps = {}
      for root, dirnames, filenames in os.walk(maps_dir):
          for filename in filenames:
              if filename.endswith(".xml"):
                  xml_file = os.path.join(root, filename)
                  map = MapSource.from_xml(xml_file, maps_dir)
                  if map.id in maps:
                      raise MapSourceException("duplicate map id: {} in file {}".format(map.id, xml_file))
                  else:
                      maps[map.id] = map
      return maps