code: def get_unique_labels(
      targets: Iterable[Text], exclude_label: Optional[Text]
  ) -> List[Text]:
      """Get unique labels. Exclude 'exclude_label' if specified.
  
      Args:
          targets: labels
          exclude_label: label to exclude
  
      Returns:
           Unique labels.
      """
      labels = set(targets)
      if exclude_label and exclude_label in labels:
          labels.remove(exclude_label)
      return list(labels)
  
imports: import copy
  import logging
  import os
  from typing import Text, Dict, Optional, List, Any, Iterable, Tuple, Union
  from pathlib import Path
  from rasa.core.agent import Agent
  from rasa.engine.storage.local_model_storage import LocalModelStorage
  import rasa.shared.utils.cli
  import rasa.shared.utils.common
  import rasa.shared.utils.io
  import rasa.utils.common
  from rasa.constants import RESULTS_FILE, NUMBER_OF_TRAINING_STORIES_FILE
  from rasa.exceptions import ModelNotFound
  from rasa.shared.constants import DEFAULT_RESULTS_PATH
  import rasa.shared.nlu.training_data.loading
  from rasa.shared.data import TrainingType
  from rasa.shared.nlu.training_data.training_data import TrainingData
  import rasa.model
label_desc: Use image node_id 7 for calling a global function with example usage: get_unique_labels(targets, exclude_label) and returns: list