code: def testGroverBondVocabularyBuilder():
      from deepchem.feat.vocabulary_builders.grover_vocab import (
          GroverBondVocabularyBuilder,
      )
  
      file = tempfile.NamedTemporaryFile()
      dataset = dc.data.NumpyDataset(X=[["CC(=O)C"], ["CCC"]])
      vocab = GroverBondVocabularyBuilder()
      vocab.build(dataset)
      assert vocab.stoi == {
          "<pad>": 0,
          "<other>": 1,
          "(SINGLE-STEREONONE-NONE)_C-(DOUBLE-STEREONONE-NONE)1_C-(SINGLE-STEREONONE-NONE)1": 2,
          "(SINGLE-STEREONONE-NONE)_C-(SINGLE-STEREONONE-NONE)1": 3,
          "(DOUBLE-STEREONONE-NONE)_C-(SINGLE-STEREONONE-NONE)2": 4,
      }
      assert vocab.itos == [
          "<pad>",
          "<other>",
          "(SINGLE-STEREONONE-NONE)_C-(DOUBLE-STEREONONE-NONE)1_C-(SINGLE-STEREONONE-NONE)1",
          "(SINGLE-STEREONONE-NONE)_C-(SINGLE-STEREONONE-NONE)1",
          "(DOUBLE-STEREONONE-NONE)_C-(SINGLE-STEREONONE-NONE)2",
      ]
      vocab.save(file.name)
  
      loaded_vocab = GroverBondVocabularyBuilder.load(file.name)
      mol = Chem.MolFromSmiles("CC(=O)C")
      bond = mol.GetBondWithIdx(0)
      assert (
          loaded_vocab.bond_to_vocab(mol, bond)
          == "(SINGLE-STEREONONE-NONE)_C-(DOUBLE-STEREONONE-NONE)1_C-(SINGLE-STEREONONE-NONE)1"
      )
      assert loaded_vocab.encode(mol, bond) == 2
  
      # test with max size
      vocab = GroverBondVocabularyBuilder(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 3 for calling a global function with example usage: testGroverBondVocabularyBuilder() without return types