code: def load_name_map(filename):
      name_map = {}
  
      with open(filename, encoding="utf-8") as f:
          for line in f:
              line = line.strip()
              if line.startswith("#") or not line:
                  continue
  
              m = re.match(r"^(.*?)\s*<(.*?)>(.*?)\s*<(.*?)>\s*$", line)
              if not m:
                  print(
                      f"Invalid line in .mailmap: '{line!r}'",
                      file=sys.stderr,
                  )
                  sys.exit(1)
  
              new_name = m.group(1).strip()
              old_name = m.group(3).strip()
  
              if old_name and new_name:
                  name_map[old_name] = new_name
  
      return name_map
  
file_path: scipy/tools/authors.py
imports: import argparse
  import re
  import sys
  import os
  import subprocess
  import collections
label_desc: Use image node_id 2 for calling a global function with example usage: load_name_map(filename) and returns: name_map