code: def run(
      shard: ShardingStrategy,
      suite: BenchmarkSuite,
      dest: Path,
      no_subdir: bool,
      cache_dir: Path,
      plot: bool,
  ) -> None:
      """Collect data for a benchmark suite."""
      if shard.setup_dest:
          metadata = BenchmarkMetadata.create(suite.name)
          dest = setup_dest(metadata, dest, no_subdir)
      else:
          assert (
              no_subdir
          ), "Must use 'no-subdir=True' with 'shard={shard}'."
          with open(dest / "metadata.json", "rt") as f:
              metadata = BenchmarkMetadata.from_json(json.load(f))
          assert metadata.suite_name == suite.name
          metadata = metadata.for_shard()
  
      if shard.print_dest:
          print(dest.resolve())
  
      if shard.write_metadata:
          metadata_path = dest / f"metadata{shard.file_suffix}.json"
          with open(metadata_path, "wt") as f:
              json.dump(metadata.to_json(), f, indent=4)
  
      metrics_df: Optional[pd.DataFrame] = None
  
      if shard.run_benchmarks:
          metrics_df = _run_benchmarks(
              metadata,
              shard,
              suite,
              dest,
              cache_dir,
          )
  
      if shard.collect:
          assert metrics_df is None
          metrics_path = dest / "metrics.csv"
          metrics_df_list = [
              pd.read_csv(p) for p in shard.find_shards(metrics_path)
          ]
          metrics_df = pd.concat(
              metrics_df_list, axis="index", ignore_index=True
          )
          metrics_df.to_csv(metrics_path, index=False)
  
      if shard.plot and plot and (metrics_df is not None):
          plot_(
              metadata=metadata,
              suite=suite,
              results_df=metrics_df,
              results_metadata=[metadata],
              dest=dest,
          )
  
imports: import argparse
  import json
  import multiprocessing
  import traceback
  from datetime import timedelta
  from pathlib import Path
  from time import perf_counter
  from typing import Mapping, Optional
  import numpy
  import pandas
  from tabulate import tabulate
  import benchmark.benchmarks
  import benchmark.metrics
  import gpflow
  from benchmark.benchmark_api import BENCHMARK_SUITES, BenchmarkSuite, BenchmarkTask
  from benchmark.dataset_api import DATASET_FACTORIES
  from benchmark.metadata import BenchmarkMetadata
  from benchmark.metric_api import Metric
  from benchmark.model_api import MODEL_FACTORIES
  from benchmark.paths import setup_dest
  from benchmark.plot import plot
  from benchmark.sharding import ShardingStrategy
label_desc: Use image node_id 4 for calling a global function with example usage: run(shard, suite, dest, no_subdir, cache_dir, plot) without return types