code: def test_categorical_encoder_length_check():
      from speechbrain.dataio.encoder import CategoricalEncoder
  
      encoder = CategoricalEncoder()
      encoder.update_from_iterable("abcd")
  
      encoder.expect_len(3)
      with pytest.raises(RuntimeError):
          encoder.encode_label("a")
  
      encoder.ignore_len()
      encoder.encode_label("a")
  
      encoder.expect_len(4)
      encoder.encode_label("a")
  
imports: import pytest
label_desc: Use image node_id 4 for calling a global function with example usage: test_categorical_encoder_length_check() without return types