code: def test_fit_transform(analyzer, per_column):
      X = pd.DataFrame(
          {
              "col1": ["hello world", "hello mars"],
              "col2": ["Test Test", "This is a test column"],
          }
      ).astype({"col1": "string", "col2": "string"})
      Vectorizer_fitted = Vectorizer(
          analyzer=analyzer,
          per_column=per_column,
          random_state=1,
      ).fit(X.copy())
  
      if per_column:
          for column in X.columns:
              Yt = Vectorizer_fitted.preprocessor[column].vocabulary_
              if column == "col1":
                  if analyzer == "word":
                      words = sorted(
                          [
                              "hello",
                              "world",
                              "mars",
                          ]
                      )  # is ignored by TFIDFVectorizer
                      Y = {key: idx for idx, key in enumerate(words)}
                      assert Yt == Y
                  else:
                      words = sorted(
                          [
                              "hell",
                              "ello",
                              "llo ",
                              "lo w",
                              "o wo",
                              " wor",
                              "worl",
                              "orld",
                              "lo m",
                              "o ma",
                              " mar",
                              "mars",
                          ]
                      )
                      Y = {key: idx for idx, key in enumerate(words)}
                      assert Yt == Y
              elif column == "col2":
                  if analyzer == "word":
                      words = sorted(
                          [
                              "test",
                              "this",
                              "is",  # "a" is not added, len(...)=1,
                              "column",
                          ]
                      )  # is ignored by TFIDFVectorizer
                      Y = {key: idx for idx, key in enumerate(words)}
                      assert Yt == Y
                  else:
                      words = sorted(
                          [
                              "test",
                              "est ",
                              "st t",
                              "t te",
                              " tes",
                              "this",
                              "his ",
                              "is i",
                              "s is",
                              " is ",
                              "is a",
                              "s a ",
                              " a t",
                              "a te",
                              "st c",
                              "t co",
                              " col",
                              "colu",
                              "olum",
                              "lumn",
                          ]
                      )
                      Y = {key: idx for idx, key in enumerate(words)}
                      assert Yt == Y
              else:
                  raise ValueError(column)
      else:
          Yt = Vectorizer_fitted.preprocessor.vocabulary_
          if analyzer == "word":
              words = sorted(
                  [
                      "hello",
                      "world",
                      "mars",
                      "test",
                      "this",
                      "is",  # "a" is not added, len(...)=1,
                      "column",
                  ]
              )  # is ignored by TFIDFVectorizer
              Y = {key: idx for idx, key in enumerate(words)}
              assert Yt == Y
          else:
              words = sorted(
                  [
                      "hell",
                      "ello",
                      "llo ",
                      "lo w",
                      "o wo",
                      " wor",
                      "worl",
                      "orld",
                      "lo m",
                      "o ma",
                      " mar",
                      "mars",
                      "test",
                      "est ",
                      "st t",
                      "t te",
                      " tes",
                      "this",
                      "his ",
                      "is i",
                      "s is",
                      " is ",
                      "is a",
                      "s a ",
                      " a t",
                      "a te",
                      "st c",
                      "t co",
                      " col",
                      "colu",
                      "olum",
                      "lumn",
                  ]
              )
              Y = {key: idx for idx, key in enumerate(words)}
              assert Yt == Y
  
file_path: auto-sklearn/test/test_pipeline/components/data_preprocessing/test_data_preprocessing_text.py
imports: import numpy
  import pandas
  from autosklearn.pipeline.components.data_preprocessing.text_encoding.tfidf_encoding import TfidfEncoder
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_fit_transform(analyzer, per_column) without return types