docs: def build_precache_map(config):
      """
      Build a mapping of contexts and models from the configuration
      """
      precache_map = {}
      ss_name = config['ores']['scoring_system']
      for context in config['scoring_systems'][ss_name]['scoring_contexts']:
          precache_map[context] = {}
          for model in config['scoring_contexts'][context].get('precache', []):
              precached_config = \
                  config['scoring_contexts'][context]['precache'][model]
  
              events = precached_config['on']
              if len(set(events) - AVAILABLE_EVENTS) > 0:
                  logger.warning("{0} events are not available"
                                 .format(set(events) - AVAILABLE_EVENTS))
              for event in precached_config['on']:
                  if event in precache_map[context]:
                      precache_map[context][event].add(model)
                  else:
                      precache_map[context][event] = {model}
                  logger.debug("Setting up precaching for {0} in {1} on {2}"
                               .format(model, context, event))
  
      return precache_map