code: def build_vocab(self):
      if isinstance(
          self.data[0][0], (list, tuple)
      ):  # general data from DataLoader
          counter = Counter(
              [
                  c
                  for sent in self.data
                  for w in sent
                  for c in w[self.idx]
              ]
          )
          for k in list(counter.keys()):
              if counter[k] < self.cutoff:
                  del counter[k]
      else:  # special data from Char LM
          counter = Counter([c for sent in self.data for c in sent])
      self._id2unit = VOCAB_PREFIX + list(
          sorted(
              list(counter.keys()),
              key=lambda k: (counter[k], k),
              reverse=True,
          )
      )
      self._unit2id = {w: i for i, w in enumerate(self._id2unit)}
  
imports: from copy import copy
  from collections import Counter, OrderedDict
  from collections.abc import Iterable
  import os
  import pickle
label_desc: Use image node_id 1 for calling the CharVocab obj's underlying member method code with example usage: obj.build_vocab() without return types