code: def test_user_fonts_win32():
      if not (os.environ.get("APPVEYOR") or os.environ.get("TF_BUILD")):
          pytest.xfail(
              "This test should only run on CI (appveyor or azure) "
              "as the developer's font directory should remain "
              "unchanged."
          )
      pytest.xfail(
          "We need to update the registry for this test to work"
      )
      font_test_file = "mpltest.ttf"
  
      # Precondition: the test font should not be available
      fonts = findSystemFonts()
      if any(font_test_file in font for font in fonts):
          pytest.skip(
              f"{font_test_file} already exists in system fonts"
          )
  
      user_fonts_dir = MSUserFontDirectories[0]
  
      # Make sure that the user font directory exists (this is probably not the
      # case on Windows versions < 1809)
      os.makedirs(user_fonts_dir)
  
      # Copy the test font to the user font directory
      shutil.copy(
          Path(__file__).parent / font_test_file, user_fonts_dir
      )
  
      # Now, the font should be available
      fonts = findSystemFonts()
      assert any(font_test_file in font for font in fonts)
  
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 13 for calling a global function with example usage: test_user_fonts_win32() without return types