code: def main(cfg):
      OmegaConf.set_struct(
          cfg, False
      )  # This allows getattr and hasattr methods to function correctly
      if cfg.pretty_print:
          print(cfg.pretty())
  
      set_debugging_vars_to_global(cfg.debugging)
  
      # Get device
      device = torch.device(
          "cuda"
          if (torch.cuda.is_available() and cfg.training.cuda)
          else "cpu"
      )
      log.info("DEVICE : {}".format(device))
  
      # Enable CUDNN BACKEND
      torch.backends.cudnn.enabled = cfg.training.enable_cudnn
  
      dataset = instantiate_dataset(cfg.data)
      model = instantiate_model(cfg, dataset)
  
      log.info(model)
      log.info(
          "Model size = %i",
          sum(
              param.numel()
              for param in model.parameters()
              if param.requires_grad
          ),
      )
  
      # Set dataloaders
      dataset.create_dataloaders(
          model,
          cfg.training.batch_size,
          cfg.training.shuffle,
          cfg.training.num_workers,
          cfg.training.precompute_multi_scale,
      )
      log.info(dataset)
  
      # Run training / evaluation
      model = model.to(device)
  
      measurement_name = "{}_{}".format(
          cfg.model_name, dataset.__class__.__name__
      )
      run(cfg, model, dataset, device, measurement_name)
  
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 4 for calling a global function with example usage: main(cfg) without return types