code: def compute_on_gpu(
      run_configs: list[DictConfig],
      device: int,
      seed: int,
      writers: list[str],
      folder: str | None = None,
      compute_openvino: bool = False,
  ):
      """Go over each run config and collect the result.
  
      Args:
          run_configs (DictConfig | ListConfig): List of run configurations.
          device (int): The GPU id used for running the sweep.
          seed (int): Fix a seed.
          writers (list[str]): Destinations to write to.
          folder (optional, str): Sub-directory to which runs are written to. Defaults to None. If none writes to root.
          compute_openvino (bool, optional): Compute OpenVINO throughput. Defaults to False.
      """
      for run_config in run_configs:
          if isinstance(run_config, (DictConfig, ListConfig)):
              model_metrics = sweep(
                  run_config, device, seed, compute_openvino
              )
              write_metrics(model_metrics, writers, folder)
          else:
              raise ValueError(
                  f"Expecting `run_config` of type DictConfig or ListConfig. Got {type(run_config)} instead."
              )
  
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 4 for calling a global function with example usage: compute_on_gpu(run_configs, device, seed, writers, folder, compute_openvino) without return types