code: def run(
      cfg,
      model: BaseModel,
      dataset: BaseDataset,
      device,
      measurement_name: str,
  ):
      measurements = {}
  
      num_batches = getattr(cfg.debugging, "num_batches", np.inf)
  
      run_epoch(model, dataset.train_dataloader, device, num_batches)
      measurements["train"] = extract_histogram(
          model.get_spatial_ops(), normalize=False
      )
  
      if dataset.has_val_loader:
          run_epoch(model, dataset.val_dataloader, device, num_batches)
          measurements["val"] = extract_histogram(
              model.get_spatial_ops(), normalize=False
          )
  
      for loader in dataset.test_dataloaders:
          run_epoch(
              model, dataset.test_dataloaders, device, num_batches
          )
          measurements[loader.dataset.name] = extract_histogram(
              model.get_spatial_ops(), normalize=False
          )
  
      with open(
          os.path.join(
              DIR, "measurements/{}.pickle".format(measurement_name)
          ),
          "wb",
      ) as f:
          pickle.dump(measurements, f)
  
imports: import os
  import torch
  import hydra
  import logging
  import numpy
  from omegaconf import OmegaConf
  import pickle
  from torch_points3d.datasets.dataset_factory import instantiate_dataset
  from torch_points3d.models.model_factory import instantiate_model
  from torch_points3d.models.base_model import BaseModel
  from torch_points3d.datasets.base_dataset import BaseDataset
  from torch_points3d.metrics.base_tracker import BaseTracker
  from torch_points3d.metrics.colored_tqdm import Coloredtqdm
  from torch_points3d.metrics.model_checkpoint import ModelCheckpoint
  from torch_points3d.utils.colors import COLORS
  from torch_points3d.utils.config import determine_stage
  from torch_points3d.visualization import Visualizer
  from torch_points3d.utils.config import set_debugging_vars_to_global
  from torch_points3d.utils.debugging_vars import extract_histogram
label_desc: Use image node_id 3 for calling a global function with example usage: run(cfg, model, dataset, device, measurement_name) without return types