code: def main(
      model_file: str,
      train_data_dir: str,
      eval_data_dir: str,
      config_file: str,
      out_file: str,
  ):
      config = _load_config(config_file)
      model = _load_model(model_file)
      train_data = _load_data(train_data_dir)
      eval_data = _load_data(eval_data_dir)
      pruned_model = _train_model(
          model, train_data, eval_data, **config
      )
      _save_model(pruned_model, out_file)
  
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 7 for calling a global function with example usage: main(model_file, train_data_dir, eval_data_dir, config_file, out_file) without return types