code: def setup(
      self,
      trainer: "pl.Trainer",
      pl_module: LightningModule,
      stage: str,
  ) -> None:
      parameters_to_prune = self.sanitize_parameters_to_prune(
          pl_module,
          self._parameters_to_prune,
          parameter_names=self._parameter_names,
      )
  
      self._parameters_to_prune = self.filter_parameters_to_prune(
          parameters_to_prune
      )
  
      if self._use_lottery_ticket_hypothesis:
          # group modules by id. Each entry has a copy of the initial data
          # and a list of the associated parameter names to prune
          self._original_layers = {}
          for i, (module, name) in enumerate(self._parameters_to_prune):
              id_ = id(module)
              self._original_layers.setdefault(
                  id_, _LayerRef(data=deepcopy(module), names=[])
              )
              self._original_layers[id_]["names"].append((i, name))
  
imports: import inspect
  import logging
  from copy import deepcopy
  from functools import partial
  from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
  import torch.nn.utils.prune
  from lightning_utilities.core.apply_func import apply_to_collection
  from torch import Tensor, nn
  from typing_extensions import TypedDict, override
  import lightning.pytorch
  from lightning.pytorch.callbacks.callback import Callback
  from lightning.pytorch.core.module import LightningModule
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning.pytorch.utilities.rank_zero import rank_zero_debug, rank_zero_only
label_desc: Use image node_id 14 for calling the ModelPruning obj's underlying member method code with example usage: obj.setup(trainer, pl_module, stage) without return types