code: def build_messages_metrics(messages):
      
      count_types = collections.Counter(
          line.get('type') or None
          for line in messages)
      count_modules = collections.Counter(
          line.get('module') or None
          for line in messages)
      count_symbols = collections.Counter(
          line.get('symbol') or None
          for line in messages)
      count_paths = collections.Counter(
          line.get('path') or None
          for line in messages)
  
      return {
          'types': count_types,
          'modules': count_modules,
          'symbols': count_symbols,
          'paths': count_paths,
      }
docs: Build reports's metrics