code: def test_duplicated_entity_predictions_tolerated():
      """Same entity extracted multiple times shouldn't be flagged as prediction error.
  
      This can happen when multiple entity extractors extract the same entity but a test
      story only lists the entity once. For completeness, the other case (entity listed
      twice in test story and extracted once) is also tested here because it should work
      the same way.
      """
      entity = {
          ENTITY_ATTRIBUTE_TEXT: "Algeria",
          ENTITY_ATTRIBUTE_START: 0,
          ENTITY_ATTRIBUTE_END: 7,
          ENTITY_ATTRIBUTE_VALUE: "Algeria",
          ENTITY_ATTRIBUTE_TYPE: "country",
      }
      evaluation_with_duplicated_prediction = EvaluationStore(
          entity_predictions=[entity, entity], entity_targets=[entity]
      )
      assert (
          not evaluation_with_duplicated_prediction.check_prediction_target_mismatch()
      )
  
      evaluation_with_duplicated_target = EvaluationStore(
          entity_predictions=[entity], entity_targets=[entity, entity]
      )
      assert (
          not evaluation_with_duplicated_target.check_prediction_target_mismatch()
      )
  
imports: import asyncio
  import sys
  from pathlib import Path
  import textwrap
  from typing import List, Text
  import pytest
  from _pytest.capture import CaptureFixture
  from _pytest.monkeypatch import MonkeyPatch
  import rasa.shared.utils.io
  import rasa.utils.io
  from rasa.core.agent import Agent
  from rasa.shared.core.events import UserUttered
  from rasa.core.test import EvaluationStore, WronglyClassifiedUserUtterance, WronglyPredictedAction
  from rasa.shared.core.trackers import DialogueStateTracker
  from rasa.shared.core.training_data.story_writer.yaml_story_writer import YAMLStoryWriter
  import rasa.model
  import rasa.cli.utils
  from rasa.nlu.test import NO_ENTITY
  import rasa.core
  from rasa.shared.nlu.constants import ENTITY_ATTRIBUTE_VALUE, ENTITY_ATTRIBUTE_START, ENTITY_ATTRIBUTE_END, ENTITY_ATTRIBUTE_TYPE, ENTITY_ATTRIBUTE_TEXT
  from rasa.shared.constants import LATEST_TRAINING_DATA_FORMAT_VERSION
label_desc: Use image node_id 13 for calling a global function with example usage: test_duplicated_entity_predictions_tolerated() without return types