code: def exit_tensorflow(port=6006):
      """Close TensorBoard and Nvidia-process if available.
  
      Parameters
      ----------
      port : int
          TensorBoard port you want to close, `6006` as default.
  
      """
      text = "[TL] Close tensorboard and nvidia-process if available"
      text2 = "[TL] Close tensorboard and nvidia-process not yet supported by this function (tl.ops.exit_tf) on "
  
      if _platform == "linux" or _platform == "linux2":
          tl.logging.info("linux: %s" % text)
          os.system("nvidia-smi")
          os.system(
              "fuser " + str(port) + "/tcp -k"
          )  # kill tensorboard 6006
          os.system(
              "nvidia-smi | grep python |awk '{print $3}'|xargs kill"
          )  # kill all nvidia-smi python process
          _exit()
  
      elif _platform == "darwin":
          tl.logging.info("OS X: %s" % text)
          subprocess.Popen(
              "lsof -i tcp:"
              + str(port)
              + "  | grep -v PID | awk '{print $2}' | xargs kill",
              shell=True,
          )  # kill tensorboard
      elif _platform == "win32":
          raise NotImplementedError(
              "this function is not supported on the Windows platform"
          )
  
      else:
          tl.logging.info(text2 + _platform)
  
imports: import os
  import random
  import subprocess
  import sys
  import time
  from collections import Counter
  from sys import exit
  from sys import platform
  import numpy
  import tensorflow
  from sklearn.metrics import accuracy_score, confusion_matrix, f1_score
  import tensorlayer
label_desc: Use image node_id 10 for calling a global function with example usage: exit_tensorflow(port) without return types