code: def generate_temp_dir():
      """generate a temp folder"""
  
      def generate_folder_name():
          return os.path.join(
              tempfile.gettempdir(),
              "nni",
              "".join(
                  random.sample(string.ascii_letters + string.digits, 8)
              ),
          )
  
      temp_dir = generate_folder_name()
      while os.path.exists(temp_dir):
          temp_dir = generate_folder_name()
      os.makedirs(temp_dir)
      return temp_dir
  
imports: import os
  import sys
  import json
  import tempfile
  import time
  import socket
  import string
  import random
  import glob
  from colorama import Fore
  import filelock
  import psutil
  import yaml
  from .constants import ERROR_INFO, NORMAL_INFO, WARNING_INFO
label_desc: Use image node_id 10 for calling a global function with example usage: generate_temp_dir() and returns: temp_dir, os