docstr: Tests that the function code is called only once for the same input.
docstr_tok: ["Tests","that","the","function","code","is","called","only","once","for","the","same","input","."]
code: def test_caching(self):
      """Tests that the function code is called only once for the same input."""
  
      side_effects = 0
  
      @numpy_cache.lru_cache(maxsize=10)
      def cached_function(a):
          nonlocal side_effects
          side_effects += 1
          return a
  
      self.assertEqual(side_effects, 0)
  
      _ = cached_function(np.zeros(1))
      self.assertEqual(side_effects, 1)
  
      _ = cached_function(np.ones(1))
      self.assertEqual(side_effects, 2)
  
      _ = cached_function(np.zeros(1))
      self.assertEqual(side_effects, 2)
  
imports: from absl.testing import absltest
  import numpy
  from scenic.projects.owl_vit.notebooks import numpy_cache
label_desc: Use image node_id 1 for calling the NumpyCacheTest obj's underlying member method code with example usage: obj.test_caching() and returns: a