code: def testPruneScope_NeededForTF1SavedModel(self):
      # TODO(b/185726968): replace with shared v1 test_util.
      is_v1_apis = hasattr(tf, "assign")
      if not is_v1_apis:
          return
  
      model = keras_test_utils.build_simple_dense_model()
      pruned_model = prune.prune_low_magnitude(model)
  
      saved_model_dir = tempfile.mkdtemp()
  
      tf.keras.experimental.export_saved_model(
          pruned_model, saved_model_dir
      )
      with self.assertRaises(ValueError):
          tf.keras.experimental.load_from_saved_model(saved_model_dir)
  
      # works with `prune_scope`
      with prune.prune_scope():
          tf.keras.experimental.load_from_saved_model(saved_model_dir)
  
imports: import json
  import tempfile
  import numpy
  import tensorflow
  from tensorflow_model_optimization.python.core.keras import test_utils
  from tensorflow_model_optimization.python.core.sparsity.keras import prunable_layer
  from tensorflow_model_optimization.python.core.sparsity.keras import prune
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_schedule
  from tensorflow_model_optimization.python.core.sparsity.keras import pruning_wrapper
label_desc: Use image node_id 30 for calling the PruneTest obj's underlying member method code with example usage: obj.testPruneScope_NeededForTF1SavedModel() without return types