class_docstr: A base class for common vocabulary operations. Each subclass should at least 
  implement its own build_vocab() function.
docstr: Returns a dictionary containing all states that are necessary to recover
  this vocab. Useful for serialization.
docstr_tok: ["Returns","a","dictionary","containing","all","states","that","are","necessary","to","recover","this","vocab",".","Useful","for","serialization","."]
code: def state_dict(self):
      """Returns a dictionary containing all states that are necessary to recover
      this vocab. Useful for serialization."""
      state = OrderedDict()
      for attr in self.state_attrs:
          if hasattr(self, attr):
              state[attr] = getattr(self, attr)
      return state
  
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 3 for calling the BaseVocab obj's underlying member method code with example usage: obj.state_dict() and returns: state