code: def get_baby_name_counts_by_gender(
      baby_name_folder: str,
  ) -> Dict[str, Dict[str, int]]:
      """
      Return a dictionary whose keys are baby names and whose values are counts of the
      number of babies given that name, split by gender.
  
      Baby name folder from https://catalog.data.gov/dataset/
      baby-names-from-social-security-card-applications-national-data,
      accessed 2021-04-02.
      """
  
      # Params
      final_baby_name_year = 2019
      baby_name_year_range = range(
          final_baby_name_year - 99, final_baby_name_year + 1
      )
      # Get the most recent 100 years of names
  
      # Get counts of baby names by gender
      baby_name_counts_by_gender = defaultdict(lambda: {"F": 0, "M": 0})
      for year in baby_name_year_range:
          counts_path = os.path.join(
              baby_name_folder, f"yob{year:d}.txt"
          )
          with open(counts_path) as f:
              for line in f:
                  name, gender, count_string = line.split(",")
                  count = int(count_string.rstrip())
                  baby_name_counts_by_gender[name][gender] += count
  
      return baby_name_counts_by_gender
  
file_path: ParlAI/projects/dialogue_bias/util.py
imports: import os
  from collections import defaultdict
  from typing import Dict, List, Tuple
  import pandas
label_desc: Use image node_id 3 for calling a global function with example usage: get_baby_name_counts_by_gender(baby_name_folder) and returns: baby_name_counts_by_gender