code: def get_data_stats(data, key="label", lst=True):
      counts = defaultdict(int)
      for ex in data:
          if lst:
              label = ex[key][0]
          else:
              label = ex[key]
          counts[label] += 1
  
      print("Total dataset counts:")
      tups = sorted(
          [(k, v) for k, v in counts.items()], key=lambda x: x[0]
      )
      for k, v in tups:
          print(f"{k}: {v}")
  
file_path: ParlAI/parlai/tasks/md_gender/utils.py
imports: import os
  import random
  from collections import defaultdict
  from parlai.tasks.md_gender.build import build
label_desc: Use image node_id 1 for calling a global function with example usage: get_data_stats(data, key, lst) without return types