code: def test_get_font_names():
      paths_mpl = [
          cbook._get_data_path("fonts", subdir) for subdir in ["ttf"]
      ]
      fonts_mpl = findSystemFonts(paths_mpl, fontext="ttf")
      fonts_system = findSystemFonts(fontext="ttf")
      ttf_fonts = []
      for path in fonts_mpl + fonts_system:
          try:
              font = ft2font.FT2Font(path)
              prop = ttfFontProperty(font)
              ttf_fonts.append(prop.name)
          except Exception:
              pass
      available_fonts = sorted(list(set(ttf_fonts)))
      mpl_font_names = sorted(fontManager.get_font_names())
      assert set(available_fonts) == set(mpl_font_names)
      assert len(available_fonts) == len(mpl_font_names)
      assert available_fonts == mpl_font_names
  
imports: from io import BytesIO, StringIO
  import gc
  import multiprocessing
  import os
  from pathlib import Path
  from PIL import Image
  import shutil
  import subprocess
  import sys
  import warnings
  import numpy
  import pytest
  from matplotlib.font_manager import findfont, findSystemFonts, FontEntry, FontProperties, fontManager, json_dump, json_load, get_font, is_opentype_cff_font, MSUserFontDirectories, _get_fontconfig_fonts, ttfFontProperty
  from matplotlib import cbook, ft2font, pyplot, rc_context, figure
label_desc: Use image node_id 21 for calling a global function with example usage: test_get_font_names() without return types