class_docstr: This class is testing examples in https://coremltools.readme.io/v7.0/docs/pruning-a-core-ml-model
code: def test_threshold_pruner(self):
      from coremltools.optimize.coreml import (
          OpThresholdPrunerConfig,
          OptimizationConfig,
          prune_weights,
      )
  
      model = get_mlmodel()
      op_config = OpThresholdPrunerConfig(
          threshold=0.03,
          minimum_sparsity_percentile=0.55,
          weight_threshold=1024,
      )
      config = OptimizationConfig(global_config=op_config)
      model_compressed = prune_weights(model, config=config)
      assert model_compressed is not None
  
imports: import tempfile
  from coremltools.converters.mil.testing_utils import get_op_types_in_program
  from coremltools.test.optimize.coreml.test_passes import TestCompressionPasses
  from coremltools.test.optimize.coreml.test_passes import TestConfigurationFromDictFromYaml
label_desc: Use image node_id 1 for calling the TestPostTrainingPruning obj's underlying member method code with example usage: obj.test_threshold_pruner() without return types