code: def create_visual_node(subclass: _T) -> _T:
      # Create a new subclass of Node.
  
      # Decide on new class name
      clsname = subclass.__name__
      if not (
          clsname.endswith("Visual")
          and issubclass(subclass, visuals.BaseVisual)
      ):
          raise RuntimeError(
              'Class "%s" must end with Visual, and must '
              "subclass BaseVisual" % clsname
          )
      clsname = clsname[:-6]
  
      # Generate new docstring based on visual docstring
      try:
          doc = generate_docstring(subclass, clsname)
      except Exception:
          # If parsing fails, just return the original Visual docstring
          doc = subclass.__doc__
  
      # New __init__ method
      def __init__(self, *args, **kwargs):
          parent = kwargs.pop("parent", None)
          name = kwargs.pop("name", None)
          self.name = name  # to allow __str__ before Node.__init__
          self._visual_superclass = subclass
  
          subclass.__init__(self, *args, **kwargs)
          self.unfreeze()
          VisualNode.__init__(self, parent=parent, name=name)
          self.freeze()
  
      # Create new class
      cls = type(
          clsname,
          (VisualNode, subclass),
          {"__init__": __init__, "__doc__": doc},
      )
  
      return cls
  
file_path: vispy/vispy/scene/visuals.py
imports: import re
  import weakref
  from ..None import visuals
  from .node import Node
  from ..visuals.filters import Alpha, PickingFilter
  from typing import TypeVar
label_desc: Use image node_id 1 for calling a global function with example usage: create_visual_node(subclass) and returns: cls