code: def LegendClassFactory(name, BaseClass=TextLegendBase):
      def __init__(self, text, color, **kwargs):
          BaseClass.__init__(self, text=text, color=color, **kwargs)
  
      new_legend_class = type(
          name, (BaseClass,), {"__init__": __init__}
      )
      return new_legend_class
  
file_path: PyWaffle/pywaffle/fontawesome_handler.py
imports: import inspect
  import pathlib
  import fontawesomefree
  import matplotlib.font_manager
  from matplotlib.legend_handler import HandlerBase
  from matplotlib.text import Text
label_desc: Use image node_id 2 for calling a global function with example usage: LegendClassFactory(name, BaseClass) and returns: new_legend_class