code: def compose_alert(alert, output, descriptor):
      """Presents the alert as a dict for output classes to send to their API integrations.
  
      Args:
          alert (Alert): The alert to be dispatched
          output (OutputDispatcher|None): Instance of the output class dispatching this alert
          descriptor (str): The descriptor for the output
  
      Returns:
          dict
      """
  
      # FIXME (derek.wang)
      #   this is here because currently the OutputDispatcher sits in a __init__.py module that
      #   performs eager loading of the other output classes. If you load this helper before
      #   the output classes are loaded, it creates a cyclical dependency
      #   helper.py -> output_base.py -> __init__ -> komand.py -> helper.py
      #   This is a temporary workaround
      #   A more permanent solution will involve refactoring the OutputDispatcher to load on-demand
      #   instead of eagerly.
      from streamalert.alert_processor.outputs.output_base import (
          OutputDispatcher,
      )
  
      output_service_name = (
          output.__service__
          if isinstance(output, OutputDispatcher)
          else None
      )
  
      if not output_service_name:
          raise PublisherAssemblyError("Invalid output service")
  
      publisher = _assemble_alert_publisher_for_output(
          alert, output_service_name, descriptor
      )
      return publisher.publish(alert, {})
  
imports: from streamalert.shared.publisher import AlertPublisherRepository, PublisherAssemblyError
label_desc: Use image node_id 2 for calling a global function with example usage: compose_alert(alert, output, descriptor) and returns: publisher