code: def add_symbol(self, s):
      if s not in self.symbol2idx:
          self.symbol2idx[s] = self.vocab_size
          self.idx2symbol[self.vocab_size] = s
          self.vocab_size += 1
      return self.symbol2idx[s]
  
imports: from operator import itemgetter
  import numpy
label_desc: Use image node_id 2 for calling the Vocab obj's underlying member method code with example usage: obj.add_symbol(s) and returns: self