code: def test_one_hot():
      sample_text = "The cat sat on the mat."
      encoded = text.one_hot(sample_text, 5)
      assert len(encoded) == 6
      assert np.max(encoded) <= 4
      assert np.min(encoded) >= 0
  
      sample_text = "The-cat-sat-on-the-mat"
      encoded2 = text.one_hot(
          sample_text, 5, analyzer=lambda t: t.lower().split("-")
      )
      assert encoded == encoded2
      assert len(encoded) == 6
      assert np.max(encoded) <= 4
      assert np.min(encoded) >= 0
  
imports: from collections import OrderedDict
  import numpy
  import pytest
  from tensorflow import keras
  from keras_preprocessing import text
label_desc: Use image node_id 1 for calling a global function with example usage: test_one_hot() without return types