input: Write a python function to terminate all running processes using psutil.
  assert isinstance(terminate_all_processes(), list)  # Should return a list of terminated processes
  assert all(proc not in psutil.pids() for proc in terminate_all_processes())  # None of the terminated processes should be running
output: def terminate_all_processes():
      import psutil
      terminated_processes = []
      for proc in psutil.process_iter(['pid']):
          try:
              proc.terminate()
              terminated_processes.append(proc.pid)
          except psutil.NoSuchProcess:
              continue
          except psutil.AccessDenied:
              continue
      return terminated_processes