code: def test_batch_seq(self):
      (a, b, c, d, e, f) = self.token_ids
  
      batch_seqs = self.modality.batch_seq([2, 1])
      self.assertEqual((2, 5), batch_seqs.shape)
      npt.assert_array_equal(
          batch_seqs, np.asarray([[c, b, e, c, f], [b, c, d, d, 0]])
      )
  
      batch_seqs = self.modality.batch_seq([0, 2], max_length=4)
      self.assertEqual((2, 4), batch_seqs.shape)
      npt.assert_array_equal(
          batch_seqs, np.asarray([[a, b, c, 0], [c, b, e, c]])
      )
  
      self.modality.sequences = None
      try:
          self.modality.batch_seq([0])
      except ValueError:
          assert True
  
imports: import unittest
  from collections import defaultdict
  import numpy
  import numpy.testing
  from cornac.data import TextModality, ReviewModality
  from cornac.data.text import SPECIAL_TOKENS, DEFAULT_PRE_RULES, BaseTokenizer, Vocabulary, CountVectorizer, TfidfVectorizer
label_desc: Use image node_id 5 for calling the TestTextModality obj's underlying member method code with example usage: obj.test_batch_seq() without return types