code: def test_doc2bow(self):
      d = Dictionary([["žluťoučký"], ["žluťoučký"]])
  
      # pass a utf8 string
      self.assertEqual(d.doc2bow(["žluťoučký"]), [(0, 1)])
  
      # doc2bow must raise a TypeError if passed a string instead of array of strings by accident
      self.assertRaises(TypeError, d.doc2bow, "žluťoučký")
  
      # unicode must be converted to utf8
      self.assertEqual(
          d.doc2bow(["\u017elu\u0165ou\u010dk\xfd"]), [(0, 1)]
      )
  
imports: from collections.abc import Mapping
  from itertools import chain
  import logging
  import unittest
  import codecs
  import os
  import os.path
  import scipy
  import gensim
  from gensim.corpora import Dictionary
  from gensim.utils import to_utf8
  from gensim.test.utils import get_tmpfile, common_texts
label_desc: Use image node_id 15 for calling the TestDictionary obj's underlying member method code with example usage: obj.test_doc2bow() without return types