code: def test_encode_sequences(
      sequences,
      vocab,
      target_size,
      sos,
      eos,
      pad,
      dynamic_len,
      error,
      out_shape,
      gts,
  ):
      if error:
          with pytest.raises(ValueError):
              utils.encode_sequences(
                  sequences,
                  vocab,
                  target_size,
                  eos,
                  sos,
                  pad,
                  dynamic_len,
              )
      else:
          out = utils.encode_sequences(
              sequences, vocab, target_size, eos, sos, pad, dynamic_len
          )
          assert isinstance(out, np.ndarray)
          assert out.shape == out_shape
          assert np.all(out == np.asarray(gts)), print(out, gts)
  
file_path: doctr/tests/common/test_datasets_utils.py
imports: import numpy
  import pytest
  from doctr.datasets import utils
label_desc: Use image node_id 6 for calling a global function with example usage: test_encode_sequences(sequences, vocab, target_size, sos, eos, pad, dynamic_len, error, out_shape, gts) without return types