code: def test_basics_integer_vocab(self):
      # Case: adapt + list inputs
      adapt_data = [1, 1, 1, 2, 2, 3]
      input_data = [1, 2, 4]
      kwargs = {
          "max_tokens": 7,
          "num_oov_indices": 1,
          "mask_token": 0,
          "oov_token": -1,
          "vocabulary_dtype": "int64",
      }
      layer = layers.IndexLookup(**kwargs)
      layer.adapt(adapt_data)
      self.assertEqual(layer.get_vocabulary(), [0, -1, 1, 2, 3])
      self.assertEqual(
          layer.get_vocabulary(include_special_tokens=False),
          [1, 2, 3],
      )
      output = layer(input_data)
      self.assertEqual(list(output), [2, 3, 1])
      if backend.backend() != "torch":
          self.run_class_serialization_test(layer)
  
      # Case: numpy array input
      output = layer(np.array(input_data))
      self.assertEqual(list(output), [2, 3, 1])
  
      # Case: fixed vocab + list inputs
      vocabulary = [1, 2, 3]
      layer = layers.IndexLookup(vocabulary=vocabulary, **kwargs)
      self.assertEqual(layer.get_vocabulary(), [0, -1, 1, 2, 3])
      self.assertEqual(
          layer.get_vocabulary(include_special_tokens=False),
          [1, 2, 3],
      )
      output = layer(input_data)
      self.assertEqual(list(output), [2, 3, 1])
      if backend.backend() != "torch":
          self.run_class_serialization_test(layer)
  
      # Case: fixed vocab with special tokens + list inputs
      vocabulary_with_special_tokens = [0, -1, 1, 2, 3]
      layer = layers.IndexLookup(
          vocabulary=vocabulary_with_special_tokens, **kwargs
      )
      self.assertEqual(layer.get_vocabulary(), [0, -1, 1, 2, 3])
      self.assertEqual(
          layer.get_vocabulary(include_special_tokens=False),
          [1, 2, 3],
      )
      output = layer(input_data)
      self.assertEqual(list(output), [2, 3, 1])
      if backend.backend() != "torch":
          self.run_class_serialization_test(layer)
  
      # Case: set vocabulary
      layer = layers.IndexLookup(**kwargs)
      layer.set_vocabulary(vocabulary)
      self.assertEqual(layer.get_vocabulary(), [0, -1, 1, 2, 3])
      self.assertEqual(
          layer.get_vocabulary(include_special_tokens=False),
          [1, 2, 3],
      )
      output = layer(input_data)
      self.assertEqual(list(output), [2, 3, 1])
      if backend.backend() != "torch":
          self.run_class_serialization_test(layer)
  
      # Case: set vocabulary (with special tokens)
      layer = layers.IndexLookup(**kwargs)
      layer.set_vocabulary(vocabulary_with_special_tokens)
      self.assertEqual(layer.get_vocabulary(), [0, -1, 1, 2, 3])
      self.assertEqual(
          layer.get_vocabulary(include_special_tokens=False),
          [1, 2, 3],
      )
      output = layer(input_data)
      self.assertEqual(list(output), [2, 3, 1])
      if backend.backend() != "torch":
          self.run_class_serialization_test(layer)
  
imports: import os
  import numpy
  import pytest
  from absl.testing import parameterized
  from tensorflow import data
  from keras import backend
  from keras import layers
  from keras import models
  from keras import testing
  from keras.saving import saving_api
label_desc: Use image node_id 2 for calling the IndexLookupLayerTest obj's underlying member method code with example usage: obj.test_basics_integer_vocab() without return types