code: def _generate_key_map(entity_list, key, entity_class):
      
  
      key_map = {}
      for obj in entity_list:
        key_map[obj[key]] = entity_class(**obj)
  
      return key_map
docs: Helper method to generate map from key to entity object for given list of dicts.
  
      Args:
        entity_list: List consisting of dict.
        key: Key in each dict which will be key in the map.
        entity_class: Class representing the entity.
  
      Returns:
        Map mapping key to entity object.