code: def _add_message_edge(
      graph: "networkx.MultiDiGraph",
      message: Optional[Dict[Text, Any]],
      current_node: int,
      next_node_idx: int,
      is_current: bool,
  ) -> None:
      """Create an edge based on the user message."""
      if message:
          message_key = message.get("intent", {}).get("name", None)
          message_label = message.get("text", None)
      else:
          message_key = None
          message_label = None
  
      _add_edge(
          graph,
          current_node,
          next_node_idx,
          message_key,
          message_label,
          **{"class": "active" if is_current else ""},
      )
  
imports: from collections import defaultdict, deque
  import random
  from typing import Any, Text, List, Deque, Dict, Optional, Set, TYPE_CHECKING, Union, cast
  import rasa.shared.utils.io
  from rasa.shared.constants import INTENT_MESSAGE_PREFIX
  from rasa.shared.core.constants import ACTION_LISTEN_NAME
  from rasa.shared.core.domain import Domain
  from rasa.shared.core.events import UserUttered, ActionExecuted, Event
  from rasa.shared.core.generator import TrainingDataGenerator
  from rasa.shared.core.training_data.structures import StoryGraph, StoryStep
  from rasa.shared.nlu.constants import ENTITY_ATTRIBUTE_VALUE, INTENT, TEXT, ENTITY_ATTRIBUTE_TYPE, INTENT_NAME_KEY
label_desc: Use image node_id 15 for calling a global function with example usage: _add_message_edge(graph, message, current_node, next_node_idx, is_current) without return types