code: def testGroverAtomVocabularyBuilder():
      from deepchem.feat.vocabulary_builders.grover_vocab import (
          GroverAtomVocabularyBuilder,
      )
  
      file = tempfile.NamedTemporaryFile()
      dataset = dc.data.NumpyDataset(X=[["CC(=O)C"], ["CCC"]])
      vocab = GroverAtomVocabularyBuilder()
      vocab.build(dataset)
      assert vocab.stoi == {
          "<pad>": 0,
          "<other>": 1,
          "C_C-SINGLE1": 2,
          "C_C-SINGLE2": 3,
          "C_C-SINGLE2_O-DOUBLE1": 4,
          "O_C-DOUBLE1": 5,
      }
      assert vocab.itos == [
          "<pad>",
          "<other>",
          "C_C-SINGLE1",
          "C_C-SINGLE2",
          "C_C-SINGLE2_O-DOUBLE1",
          "O_C-DOUBLE1",
      ]
      vocab.save(file.name)
  
      loaded_vocab = GroverAtomVocabularyBuilder.load(file.name)
      mol = Chem.MolFromSmiles("CC(=O)C")
      atom = mol.GetAtomWithIdx(0)
      assert loaded_vocab.atom_to_vocab(mol, atom) == "C_C-SINGLE1"
      assert loaded_vocab.encode(mol, mol.GetAtomWithIdx(0)) == 2
  
      # test with max size
      vocab = GroverAtomVocabularyBuilder(max_size=3)
      vocab.build(dataset)
      assert vocab.size == 3
      assert vocab.size == len(vocab.itos)
  
file_path: deepchem/deepchem/feat/vocabulary_builders/tests/test_grover_vocab.py
imports: import tempfile
  import os
  import pandas
  from rdkit import Chem
  import deepchem
label_desc: Use image node_id 1 for calling a global function with example usage: testGroverAtomVocabularyBuilder() without return types