code: def find_tf_dependency():
      install_tf, tf_gpu = False, False
      try:
          import tensorflow as tf
  
          if tf.__version__ < LooseVersion("1.8.0"):
              install_tf = True
              # check if a gpu version is needed
              tf_gpu = tf.test.is_gpu_available()
      except ImportError:
          install_tf = True
          # Check if a nvidia gpu is present
          for command in [
              "nvidia-smi",
              "/usr/bin/nvidia-smi",
              "nvidia-smi.exe",
          ]:
              try:
                  if subprocess.call([command]) == 0:
                      tf_gpu = True
                      break
              except (
                  IOError
              ):  # command does not exist / is not executable
                  pass
          if (
              os.environ.get("USE_GPU") == "True"
          ):  # force GPU even if not auto-detected
              tf_gpu = True
  
      tf_dependency = []
      if install_tf:
          tf_dependency = (
              ["tensorflow-gpu>=1.8.0,<2.0.0"]
              if tf_gpu
              else ["tensorflow>=1.8.0,<2.0.0"]
          )
          if tf_gpu:
              print(
                  "A GPU was detected, tensorflow-gpu will be installed"
              )
  
      return tf_dependency
  
imports: import os
  import sys
  import subprocess
  from setuptools import setup, find_packages
  from distutils.version import LooseVersion
label_desc: Use image node_id 1 for calling a global function with example usage: find_tf_dependency() and returns: tf_dependency