code: def test_check_vocabulary():
      X = pd.DataFrame(
          {
              "col1": ["hello world", "this is test", None],
              "col2": ["test test", "test test", "test"],
          }
      ).astype({"col1": "string", "col2": "string"})
      vectorizer = Vectorizer(
          per_column=True,
          analyzer="word",
          random_state=1,
      ).fit(X.copy())
      assert vectorizer.preprocessor["col1"].vocabulary_ == {
          "hello": 0,
          "world": 4,
          "this": 3,
          "is": 1,
          "test": 2,
      }
      assert vectorizer.preprocessor["col2"].vocabulary_ == {"test": 0}
  
      vectorizer = Vectorizer(
          analyzer="word",
          per_column=False,
          random_state=1,
      ).fit(X.copy())
      assert vectorizer.preprocessor.vocabulary_ == {
          "hello": 0,
          "world": 4,
          "this": 3,
          "is": 1,
          "test": 2,
      }
  
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 5 for calling a global function with example usage: test_check_vocabulary() without return types