code: def create_extractor(visualizer: object):
      """
      Create an extractor for the provided visualizer
      """
      if isinstance(visualizer, CompoundVisualizer):
          extractors = [
              create_extractor(v) for v in visualizer.visualizers
          ]
          return CompoundExtractor(extractors)
      elif isinstance(visualizer, DensePoseResultsVisualizer):
          return DensePoseResultExtractor()
      elif isinstance(visualizer, ScoredBoundingBoxVisualizer):
          return CompoundExtractor(
              [
                  extract_boxes_xywh_from_instances,
                  extract_scores_from_instances,
              ]
          )
      elif isinstance(visualizer, BoundingBoxVisualizer):
          return extract_boxes_xywh_from_instances
      elif isinstance(visualizer, DensePoseOutputsVertexVisualizer):
          return DensePoseOutputsExtractor()
      else:
          logger = logging.getLogger(__name__)
          logger.error(f"Could not create extractor for {visualizer}")
          return None
  
imports: import logging
  from typing import List, Optional, Sequence, Tuple
  import torch
  from detectron2.layers.nms import batched_nms
  from detectron2.structures.instances import Instances
  from densepose.converters import ToChartResultConverterWithConfidences
  from densepose.structures import DensePoseChartResultWithConfidences, DensePoseEmbeddingPredictorOutput
  from densepose.vis.bounding_box import BoundingBoxVisualizer, ScoredBoundingBoxVisualizer
  from densepose.vis.densepose_outputs_vertex import DensePoseOutputsVertexVisualizer
  from densepose.vis.densepose_results import DensePoseResultsVisualizer
  from .base import CompoundVisualizer
label_desc: Use image node_id 3 for calling a global function with example usage: create_extractor(visualizer) and returns: CompoundExtractor, DensePoseResultExtractor, CompoundExtractor, extract_boxes_xywh_from_instances, DensePoseOutputsExtractor, None