code: def build_recipe(
      self, epochs_pruning_window=None, training_epochs=10
  ):
      self._make_analysis()
      self._compute_loss_sensitivity()
  
      if epochs_pruning_window is None:
          epochs = default_epochs_distribution(training_epochs)
      else:
          # TODO: set custom parameters
          epochs = default_epochs_distribution(training_epochs)
          epochs_dict = epochs._asdict()
          epochs_dict.update(epochs_pruning_window)
          epochs = epochs.__class__(**epochs_dict)
  
      mods = [
          EpochRangeModifier(
              start_epoch=epochs.start_epoch,
              end_epoch=epochs.end_epoch,
          )
      ]
  
      node_weight_name_lookup = {
          node["id"]: node["weight_name"]
          for node in self.analysis["nodes"]
          if node["prunable"]
      }
  
      sparsity_to_params = {}
  
      nodes = self.final_analysis[0]
  
      for node in nodes:
          sparsity = node["sparsity"]
          node_id = node["node_id"]
          weight_name = node_weight_name_lookup[node_id]
  
          if sparsity is None:
              continue
  
          if sparsity not in sparsity_to_params:
              sparsity_to_params[sparsity] = []
  
          sparsity_to_params[sparsity].append(weight_name)
  
      for sparsity, params in sparsity_to_params.items():
          gm_pruning = GMPruningModifier(
              init_sparsity=0.05,
              final_sparsity=sparsity,
              start_epoch=epochs.pruning_start_epoch,
              end_epoch=epochs.pruning_end_epoch,
              update_frequency=epochs.pruning_update_frequency,
              params=params,
          )
  
          mods.append(gm_pruning)
  
      return ScheduledModifierManager(mods)
  
imports: import json
  import logging
  import os.path
  from pathlib import Path
  from tempfile import TemporaryDirectory
  from typing import Tuple, List, Any, Dict
  import torch
  from sparseml.onnx.optim import ModelAnalyzer, pruning_loss_sens_magnitude
  from sparseml.pytorch.optim import ScheduledModifierManager
  from sparseml.pytorch.sparsification import EpochRangeModifier, GMPruningModifier
  from sparseml.pytorch.utils import ModuleExporter
  from sparsify.blueprints.utils import default_epochs_distribution, PruningModelEvaluator, default_pruning_settings
  from sparsify.schemas import ProjectModelAnalysisSchema
  from torch.nn import CrossEntropyLoss, MSELoss
  from torch.optim import SGD
  from tqdm.auto import tqdm
label_desc: Use image node_id 4 for calling the RecipeBuilder obj's underlying member method code with example usage: obj.build_recipe(epochs_pruning_window, training_epochs) and returns: ScheduledModifierManager