class_docstr: Tests for memory leaks in NLU the CRF when using dense features.
code: def function_to_profile(self) -> None:
      import rasa.model_training
  
      config = {
          "pipeline": [
              {"name": "SpacyNLP"},
              {"name": "SpacyTokenizer"},
              {"name": "SpacyFeaturizer"},
              {
                  "name": "CRFEntityExtractor",
                  "features": [
                      ["pos", "pos2"],
                      [
                          "bias",
                          "prefix5",
                          "prefix2",
                          "suffix5",
                          "suffix3",
                          "suffix2",
                          "pos",
                          "pos2",
                          "digit",
                          "text_dense_features",
                      ],
                      ["pos", "pos2"],
                  ],
              },
          ]
      }
  
      with TempDirectoryPath(get_temp_dir_name()) as temp_dir:
          config_for_test = Path(temp_dir) / "test_config.yml"
          rasa.shared.utils.io.write_yaml(config, config_for_test)
  
          rasa.model_training.train_nlu(
              str(config_for_test),
              str(
                  Path(
                      "data",
                      "test_nlu_no_responses",
                      "sara_nlu_data.yml",
                  )
              ),
              output=temp_dir,
          )
  
imports: import abc
  import json
  import subprocess
  import sys
  import time
  from pathlib import Path
  from typing import Text, List, Tuple, Optional, Union
  import memory_profiler
  import psutil
  import pytest
  import rasa
  import rasa.shared.utils.io
  from rasa.utils.common import TempDirectoryPath, get_temp_dir_name
label_desc: Use image node_id 3 for calling the TestCRFDenseFeaturesLeak obj's underlying member method code with example usage: obj.function_to_profile() without return types