code: def _get_converter(
      renderer_class, renderer_id, props, data
  ) -> Union[VegaConverter, ImageConverter]:
      from dvc_render import ImageRenderer, VegaRenderer
  
      if renderer_class.TYPE == VegaRenderer.TYPE:
          return VegaConverter(renderer_id, data, props)
      if renderer_class.TYPE == ImageRenderer.TYPE:
          return ImageConverter(renderer_id, data, props)
  
      raise ValueError(f"Invalid renderer class {renderer_class}")
  
imports: from typing import Dict, List, Union
  from dvc.render import REVISION, REVISIONS, SRC, TYPE_KEY
  from dvc.render.converter.image import ImageConverter
  from dvc.render.converter.vega import VegaConverter
label_desc: Use image node_id 1 for calling a global function with example usage: _get_converter(renderer_class, renderer_id, props, data) and returns: VegaConverter, ImageConverter