code: def distribute(config: DictConfig | ListConfig):
      """Run all cpu experiments on a single process. Distribute gpu experiments over all available gpus.
  
      Args:
          config: (DictConfig | ListConfig): Sweep configuration.
      """
  
      runs_folder = datetime.strftime(
          datetime.now(), "%Y_%m_%d-%H_%M_%S"
      )
      devices = config.hardware
      if not torch.cuda.is_available() and "gpu" in devices:
          pl_logger.warning(
              "Config requested GPU benchmarking but torch could not detect any cuda enabled devices"
          )
      elif {"cpu", "gpu"}.issubset(devices):
          # Create process for gpu and cpu
          with ProcessPoolExecutor(
              max_workers=2,
              mp_context=multiprocessing.get_context("spawn"),
          ) as executor:
              jobs = [
                  executor.submit(compute_on_cpu, config, runs_folder),
                  executor.submit(
                      distribute_over_gpus, config, runs_folder
                  ),
              ]
              for job in as_completed(jobs):
                  try:
                      job.result()
                  except Exception as exception:
                      raise Exception(
                          f"Error occurred while computing benchmark on device {job}"
                      ) from exception
      elif "cpu" in devices:
          compute_on_cpu(config, folder=runs_folder)
      elif "gpu" in devices:
          distribute_over_gpus(config, folder=runs_folder)
      if "wandb" in config.writer:
          upload_to_wandb(team="anomalib", folder=runs_folder)
      if "comet" in config.writer:
          upload_to_comet(folder=runs_folder)
  
imports: from __future__ import annotations
  import functools
  import io
  import logging
  import math
  import multiprocessing
  import sys
  import time
  import warnings
  from argparse import ArgumentParser
  from concurrent.futures import ProcessPoolExecutor, as_completed
  from datetime import datetime
  from pathlib import Path
  from tempfile import TemporaryDirectory
  from typing import cast
  import torch
  from omegaconf import DictConfig, ListConfig, OmegaConf
  from pytorch_lightning import Trainer, seed_everything
  from utils import upload_to_comet, upload_to_wandb, write_metrics
  from anomalib.config import get_configurable_parameters, update_input_size_config
  from anomalib.data import get_datamodule
  from anomalib.deploy import export
  from anomalib.deploy.export import ExportMode
  from anomalib.models import get_model
  from anomalib.utils.loggers import configure_logger
  from anomalib.utils.sweep import get_openvino_throughput, get_run_config, get_sweep_callbacks, get_torch_throughput, set_in_nested_config
label_desc: Use image node_id 6 for calling a global function with example usage: distribute(config) without return types