code: def num_available_gpus():
      local_devices = device_lib.list_local_devices()
      num_gpus = sum(
          1 for device in local_devices if device.device_type == "GPU"
      )
      if not math.log2(num_gpus).is_integer():
          raise RuntimeError(
              "Unsupported number of GPUs. This test can run on: 2^n GPUs."
          )
      return num_gpus
  
imports: import math
  import numpy
  import nvidia.dali.fn
  import nvidia.dali.plugin.tf
  import nvidia.dali.types
  import os
  import tensorflow
  from contextlib import contextmanager
  from nose import SkipTest
  from nvidia.dali.pipeline import Pipeline
  from tensorflow.python.client import device_lib
  from test_utils import to_array, get_dali_extra_path
label_desc: Use image node_id 3 for calling a global function with example usage: num_available_gpus() and returns: num_gpus