code: def test_graph_reg_with_dynamic_embedding(
      self, dense_layer_index, model_fn
  ):
      client = MockNeighborCacheClient()
      self._test_training_with_two_neighbors(
          dense_layer_index, model_fn, neighbor_cache_client=client
      )
  
      if tf.executing_eagerly():
          # In eager mode, GraphRegularizationWithCaching.call() is invoked twice,
          # with an additional call when initializing the graph from the function.
          self.assertEqual(2, client.invocation_counter_map["lookup"])
          self.assertEqual(4, client.invocation_counter_map["update"])
      else:
          self.assertEqual(1, client.invocation_counter_map["lookup"])
          self.assertEqual(2, client.invocation_counter_map["update"])
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  from neural_structured_learning import configs
  from research.carls import graph_regularization
  from research.carls import neighbor_cache_client
  import numpy
  import tensorflow
  from google.protobuf import text_format
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 10 for calling the GraphRegularizationWithCachingTest obj's underlying member method code with example usage: obj.test_graph_reg_with_dynamic_embedding(dense_layer_index, model_fn) without return types