code: def test_vocab_lookup(self):
      # There are bugs with just making this a script, eventually these can be simpler
      class LookupWord(jit.ScriptModule):
          def __init__(self, vocab):
              super().__init__()
              self.vocab = vocab
  
          @jit.script_method
          def forward(self, word: str):
              return self.vocab.idx[word]
  
      lookup_word = LookupWord(self.vocab)
  
      self.assertEqual(1, lookup_word("a"))
      self.assertEqual(3, lookup_word("c"))
      with self.assertRaises(Exception):
          lookup_word("notaword")
  
file_path: pytext/pytext/torchscript/tests/test_vocab.py
imports: import unittest
  import torch
  from pytext.torchscript.vocab import ScriptVocabulary
  from torch import jit
label_desc: Use image node_id 2 for calling the VocabTest obj's underlying member method code with example usage: obj.test_vocab_lookup() and returns: self