code: def test_variables_to_restore_from_model(self):
      model = modeling.DeepVariantModel("test", "path")
      # We haven't created a slim model, so the variables_to_restore_from_model
      # should be returning an empty list.
      self.assertEqual([], model.variables_to_restore_from_model())
  
      # Create two model variable and one regular variables.
      with tf.compat.v1.variable_scope("model"):
          with tf.compat.v1.variable_scope("l1"):
              w1 = slim.model_variable("w1", shape=[10, 3, 3])
          with tf.compat.v1.variable_scope("l2"):
              w2 = slim.model_variable("w2", shape=[10, 3, 3])
              w3 = slim.model_variable("w3", shape=[10, 3, 3])
      v1 = slim.variable("my_var", shape=[20, 1])
  
      # The only variables in the system are the three we've created.
      self.assertCountEqual([w1, w2, w3, v1], slim.get_variables())
  
      # We get just the three model variables without any excludes.
      self.assertCountEqual(
          [w1, w2, w3], model.variables_to_restore_from_model()
      )
      # As well as when exclude_scopes is an empty list.
      self.assertCountEqual(
          [w1, w2, w3],
          model.variables_to_restore_from_model(exclude_scopes=[]),
      )
  
      # Excluding model/l1 variables gives us w2 and w3.
      self.assertCountEqual(
          [w2, w3],
          model.variables_to_restore_from_model(
              exclude_scopes=["model/l1"]
          ),
      )
      # Excluding model/l2 gives us just w1 back.
      self.assertCountEqual(
          [w1],
          model.variables_to_restore_from_model(
              exclude_scopes=["model/l2"]
          ),
      )
      # Excluding multiple scopes works as expected.
      self.assertCountEqual(
          [],
          model.variables_to_restore_from_model(
              exclude_scopes=["model/l1", "model/l2"]
          ),
      )
      # Excluding the root model scope also produces no variables..
      self.assertCountEqual(
          [],
          model.variables_to_restore_from_model(
              exclude_scopes=["model"]
          ),
      )
  
imports: from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  import tensorflow
  import tf_slim
  from deepvariant import dv_constants
  from deepvariant import dv_utils_using_clif
  from deepvariant import modeling
label_desc: Use image node_id 7 for calling the ModelingTest obj's underlying member method code with example usage: obj.test_variables_to_restore_from_model() without return types