code: def train_tf_vanilla(
      *,
      config: dict,
      num_workers: int = 4,
      cpus_per_worker: int = 8,
      use_gpu: bool = False,
  ) -> Tuple[float, float, float]:
      # This function is kicked off by the main() function and subsequently kicks
      # off tasks that run train_tf_vanilla_worker() on the worker nodes.
      from benchmark_util import (
          upload_file_to_all_nodes,
          create_actors_with_options,
          run_commands_on_actors,
          run_fn_on_actors,
          get_ip_port_actors,
      )
  
      path = os.path.abspath(__file__)
      upload_file_to_all_nodes(path)
  
      num_epochs = config["epochs"]
  
      actors = create_actors_with_options(
          num_actors=num_workers,
          resources={
              "CPU": cpus_per_worker,
              "GPU": int(use_gpu),
          },
      )
  
      run_fn_on_actors(
          actors=actors,
          fn=lambda: os.environ.pop("OMP_NUM_THREADS", None),
      )
  
      ips_ports = get_ip_port_actors(actors=actors)
      ip_port_list = [f"{ip}:{port}" for ip, port in ips_ports]
      ip_port_str = ",".join(ip_port_list)
  
      cmds = [
          [
              "python",
              path,
              "worker",
              "--num-epochs",
              str(num_epochs),
              "--num-workers",
              str(num_workers),
              "--rank",
              str(rank),
              "--worker-ip-ports",
              ip_port_str,
              "--batch-size",
              str(config["batch_size"]),
          ]
          + (["--use-gpu"] if use_gpu else [])
          for rank in range(num_workers)
      ]
  
      run_fn_on_actors(
          actors=actors,
          fn=lambda: os.environ.setdefault("OMP_NUM_THREADS", "1"),
      )
  
      start_time = time.monotonic()
      run_commands_on_actors(actors=actors, cmds=cmds)
      time_taken = time.monotonic() - start_time
  
      loss = local_time_taken = 0.0
      if os.path.exists(VANILLA_RESULT_JSON):
          with open(VANILLA_RESULT_JSON, "r") as f:
              result = json.load(f)
          loss = result["loss"]
          local_time_taken = result["local_time_taken"]
  
      return time_taken, local_time_taken, loss
  
file_path: ray/release/air_tests/air_benchmarks/workloads/tensorflow_benchmark.py
imports: import json
  import os
  import time
  from pathlib import Path
  import click
  import numpy
  import tensorflow
  from typing import List, Tuple
label_desc: Use image node_id 6 for calling a global function with example usage: train_tf_vanilla() and returns: time_taken,  local_time_taken,  loss