<commit_before>import copy
import logging
import os
import time
from collections import deque
from enum import Enum
from typing import (
    Dict,
    Text,
    Any,
    Optional,
    Iterator,
    Generator,
    Type,
    List,
    Deque,
    Iterable,
    Union,
    FrozenSet,
    Tuple,
    TYPE_CHECKING,
)

import rasa.shared.utils.io
from rasa.shared.constants import DEFAULT_SENDER_ID
from rasa.shared.nlu.constants import (
    ENTITY_ATTRIBUTE_VALUE,
    ENTITY_ATTRIBUTE_TYPE,
    ENTITY_ATTRIBUTE_GROUP,
    ENTITY_ATTRIBUTE_ROLE,
    ACTION_TEXT,
    ACTION_NAME,
    ENTITIES,
)
from rasa.shared.core import events
from rasa.shared.core.constants import (
    ACTION_LISTEN_NAME,
    LOOP_NAME,
    SHOULD_NOT_BE_SET,
    PREVIOUS_ACTION,
    ACTIVE_LOOP,
    LOOP_REJECTED,
    TRIGGER_MESSAGE,
    LOOP_INTERRUPTED,
    ACTION_SESSION_START_NAME,
    FOLLOWUP_ACTION,
)
from rasa.shared.core.conversation import Dialogue
from rasa.shared.core.events import (
    UserUttered,
    ActionExecuted,
    Event,
    SlotSet,
    Restarted,
    ActionReverted,
    UserUtteranceReverted,
    BotUttered,
    ActiveLoop,
    SessionStarted,
    ActionExecutionRejected,
    EntitiesAdded,
)
from rasa.shared.core.domain import Domain, State
from rasa.shared.core.slots import Slot

if TYPE_CHECKING:
    from typing_extension import TypedDict

    from rasa.shared.core.training_data.structures import Story
    from rasa.shared.core.training_data.story_writer.story_writer import StoryWriter

    # precise type definition for `DialogueStateTracker.active_loop`
    TrackerActiveLoop = TypedDict(
        "TrackerActiveLoop",
        {
            LOOP_NAME: Text,
            LOOP_INTERRUPTED: bool,
            LOOP_REJECTED: bool,
            TRIGGER_MESSAGE: Dict,
        },
        total=False,
    )


logger = logging.getLogger(__name__)<commit_msg>Update type definition of TrackerActiveLoop<commit_after>import copy
import logging
import os
import time
from collections import deque
from enum import Enum
from typing import (
    Dict,
    Text,
    Any,
    Optional,
    Iterator,
    Generator,
    Type,
    List,
    Deque,
    Iterable,
    Union,
    FrozenSet,
    Tuple,
    TYPE_CHECKING,
)

import rasa.shared.utils.io
from rasa.shared.constants import DEFAULT_SENDER_ID
from rasa.shared.nlu.constants import (
    ENTITY_ATTRIBUTE_VALUE,
    ENTITY_ATTRIBUTE_TYPE,
    ENTITY_ATTRIBUTE_GROUP,
    ENTITY_ATTRIBUTE_ROLE,
    ACTION_TEXT,
    ACTION_NAME,
    ENTITIES,
)
from rasa.shared.core import events
from rasa.shared.core.constants import (
    ACTION_LISTEN_NAME,
    LOOP_NAME,
    SHOULD_NOT_BE_SET,
    PREVIOUS_ACTION,
    ACTIVE_LOOP,
    LOOP_REJECTED,
    TRIGGER_MESSAGE,
    LOOP_INTERRUPTED,
    ACTION_SESSION_START_NAME,
    FOLLOWUP_ACTION,
)
from rasa.shared.core.conversation import Dialogue
from rasa.shared.core.events import (
    UserUttered,
    ActionExecuted,
    Event,
    SlotSet,
    Restarted,
    ActionReverted,
    UserUtteranceReverted,
    BotUttered,
    ActiveLoop,
    SessionStarted,
    ActionExecutionRejected,
    EntitiesAdded,
)
from rasa.shared.core.domain import Domain, State
from rasa.shared.core.slots import Slot

if TYPE_CHECKING:
    from typing_extension import TypedDict

    from rasa.shared.core.training_data.structures import Story
    from rasa.shared.core.training_data.story_writer.story_writer import StoryWriter

    # precise type definition for `DialogueStateTracker.active_loop`
    TrackerActiveLoop = TypedDict(
        "TrackerActiveLoop",
        {
            LOOP_NAME: Optional[Text],
            LOOP_INTERRUPTED: bool,
            LOOP_REJECTED: bool,
            TRIGGER_MESSAGE: Dict,
        },
        total=False,
    )


logger = logging.getLogger(__name__)
{'fraction_non_alphanumeric': 0.06253312135665076, 'fraction_numerical': 0.0, 'mean_word_length': 3.0988056460369164, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '748319', 'n_tokens_mistral': 1270, 'n_tokens_neox': 1231, 'n_words': 257}