code: def get_available_gpus(gpu_mem_needed=None, strict=False):
      gpus = _get_gpu_info()
  
      def check_gpu_nomem_strict(gpu):
          return memstr2int(
              gpu.find("fb_memory_usage").find("used").text
          ) < memstr2int(gpu.find("fb_memory_usage").find("free").text)
  
      if gpu_mem_needed is None:
          if strict:
              return [
                  gpu.find("minor_number").text
                  for gpu in gpus
                  if check_gpu_nomem_strict(gpu)
              ]
          return [gpu.find("minor_number").text for gpu in gpus]
  
      gpu_mem_needed = memstr2int(gpu_mem_needed)
  
      def check_gpu_mem_strict(gpu):
          return gpu_mem_needed < memstr2int(
              gpu.find("fb_memory_usage").find("free").text
          )
  
      def check_gpu_mem_loose(gpu):
          return (
              gpu_mem_needed
              < memstr2int(
                  gpu.find("fb_memory_usage").find("total").text
              )
          ) and check_gpu_nomem_strict(gpu)
  
      if strict:
          return [
              gpu.find("minor_number").text
              for gpu in gpus
              if check_gpu_mem_strict(gpu)
          ]
      return [
          gpu.find("minor_number").text
          for gpu in gpus
          if check_gpu_mem_loose(gpu)
      ]
  
file_path: studio/studio/util/gpu_util.py
imports: import os
  import subprocess
  import xml.etree.ElementTree
  from studio.util.util import sixdecode
label_desc: Use image node_id 2 for calling a global function with example usage: get_available_gpus(gpu_mem_needed, strict) and returns: unknown, unknown, unknown, unknown, unknown, unknown, unknown