code: def test_differently_ordered_entity_predictions_tolerated():
      """The order in which entities were extracted shouldn't matter.
  
      Let's have an utterance like this: "[Researcher](job_name) from [Germany](country)."
      and imagine we use different entity extractors for the two entities. Then, the order
      in which entities are extracted from the utterance depends on the order in which the
      extractors are listed in the NLU pipeline. However, the expected order is given by
      where the entities are found in the utterance, i.e. "Researcher" comes before
      "Germany". Hence, it's reasonable for the expected and extracted order to not match
      and it shouldn't be flagged as a prediction error.
  
      """
      entity1 = {
          ENTITY_ATTRIBUTE_TEXT: "Algeria and Albania",
          ENTITY_ATTRIBUTE_START: 0,
          ENTITY_ATTRIBUTE_END: 7,
          ENTITY_ATTRIBUTE_VALUE: "Algeria",
          ENTITY_ATTRIBUTE_TYPE: "country",
      }
      entity2 = {
          ENTITY_ATTRIBUTE_TEXT: "Algeria and Albania",
          ENTITY_ATTRIBUTE_START: 12,
          ENTITY_ATTRIBUTE_END: 19,
          ENTITY_ATTRIBUTE_VALUE: "Albania",
          ENTITY_ATTRIBUTE_TYPE: "country",
      }
      evaluation = EvaluationStore(
          entity_predictions=[entity1, entity2],
          entity_targets=[entity2, entity1],
      )
      assert not evaluation.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 14 for calling a global function with example usage: test_differently_ordered_entity_predictions_tolerated() without return types