code: def _cached_get_afm_from_fname(fname):
      with open(fname, "rb") as fh:
          return AFM(fh)
  
imports: from io import BytesIO
  import functools
  from fontTools import subset
  import matplotlib
  from ..None import font_manager, ft2font
  from .._afm import AFM
  from ..backend_bases import RendererBase
label_desc: Use image node_id 1 for calling a global function with example usage: _cached_get_afm_from_fname(fname) and returns: AFM