class_docstr: Holds loaded intent and entity training data.
class_docstr_tok: ["Holds","loaded","intent","and","entity","training","data","."]
docstr: Makes sure the training data is clean.
  
  Remove trailing whitespaces from intent and response annotations and drop
  duplicate examples.
docstr_tok: ["Makes","sure","the","training","data","is","clean",".","Remove","trailing","whitespaces","from","intent","and","response","annotations","and","drop","duplicate","examples","."]
code: def sanitize_examples(examples: List[Message]) -> List[Message]:
      """Makes sure the training data is clean.
  
      Remove trailing whitespaces from intent and response annotations and drop
      duplicate examples.
      """
      for ex in examples:
          if ex.get(INTENT):
              ex.set(INTENT, ex.get(INTENT).strip())
  
          if ex.get(RESPONSE):
              ex.set(RESPONSE, ex.get(RESPONSE).strip())
  
      return list(OrderedDict.fromkeys(examples))
  
imports: import logging
  import os
  from pathlib import Path
  import random
  from collections import Counter, OrderedDict
  import copy
  from os.path import relpath
  from typing import Any, Dict, List, Optional, Set, Text, Tuple, Callable
  import operator
  import rasa.shared.data
  from rasa.shared.utils.common import lazy_property
  import rasa.shared.utils.io
  from rasa.shared.nlu.constants import RESPONSE, INTENT_RESPONSE_KEY, ENTITY_ATTRIBUTE_TYPE, ENTITY_ATTRIBUTE_GROUP, ENTITY_ATTRIBUTE_ROLE, NO_ENTITY_TAG, INTENT, ENTITIES, TEXT, ACTION_NAME
  from rasa.shared.nlu.training_data.message import Message
  from rasa.shared.nlu.training_data import util
label_desc: Use image node_id 8 for calling the TrainingData obj's underlying member method code with example usage: obj.sanitize_examples(examples) and returns: list