text: import sys
  import gc
  import torch
  import psutil
  
  # Prompts the user with a yes or no question, returns true if yes, else false
  def query_yes_no(question, default="yes"):
      valid = {"yes": True, "y": True, "ye": True,
               "no": False, "n": False}
      if default is None:
          prompt = " [y/n] "
      elif default == "yes":
          prompt = " [Y/n] "
      elif default == "no":
          prompt = " [y/N] "
      else:
          raise ValueError("invalid default answer: '%s'" % default)
  
      while True:
          sys.stdout.write(question + prompt)
          choice = raw_input().lower()
          if default is not None and choice == '':
              return valid[default]
          elif choice in valid:
              return valid[choice]
          else:
              sys.stdout.write("Please respond with 'yes' or 'no' "
                               "(or 'y' or 'n').\n")
  
  def memReport():
      for obj in gc.get_objects():
          if torch.is_tensor(obj):
              print(type(obj), obj.size())
      
  def cpuStats():
      print(sys.version)
      print(psutil.cpu_percent())
      print(psutil.virtual_memory())  # physical memory usage
      pid = os.getpid()
      py = psutil.Process(pid)
      memoryUse = py.memory_info()[0] / 2. ** 30  # memory use in GB...I think
      print('memory GB:', memoryUse)
  
  