code: def generate_process_status_table(
      process_list: List,
  ) -> Tuple[Table, bool]:
      """Generate a table to show the status of the processes being exected.
  
      Args:
          process_list (list): each item in the list
          is a tuple of ip_address, process and jupyter token
  
      Returns:
          Tuple[Table, bool]: table of process status and flag to indicate if all processes are executed.
      """
  
      process_statuses: List[str] = []
      lines_to_display = 5  # Number of lines to display as output
  
      table = Table(title="Virtual Machine Status")
      table.add_column("PID", style="cyan")
      table.add_column("IpAddress", style="magenta")
      table.add_column("Status")
      table.add_column("Jupyter Token", style="white on black")
      table.add_column("Log", overflow="fold", no_wrap=False)
  
      for ip_address, process, jupyter_token in process_list:
          process_status = get_process_status(process)
  
          process_statuses.append(process_status)
  
          process_log = []
          if process_status == ProcessStatus.FAILED.value:
              process_log += process.stderr.readlines(lines_to_display)
          else:
              process_log += process.stdout.readlines(lines_to_display)
  
          process_log_str = "\n".join(
              log.decode("utf-8") for log in process_log
          )
          process_log_str = process_log_str if process_log else "-"
  
          table.add_row(
              f"{process.pid}",
              f"{ip_address}",
              f"{process_status}",
              f"{jupyter_token}",
              f"{process_log_str}",
          )
  
      processes_completed = (
          ProcessStatus.RUNNING.value not in process_statuses
      )
  
      return table, processes_completed
  
imports: from enum import Enum
  import hashlib
  import importlib
  import importlib.machinery
  import importlib.util
  import json
  import os
  from pathlib import Path
  import random
  import shutil
  import socket
  import subprocess
  from typing import List
  from typing import Optional
  from typing import Tuple
  from typing import Union
  import git
  import requests
  import rich
  from rich import console
  from rich import progress
  from rich.table import Table
  from .cache import DEFAULT_BRANCH
  from .mode import EDITABLE_MODE
  from .mode import hagrid_root
label_desc: Use image node_id 24 for calling a global function with example usage: generate_process_status_table(process_list) and returns: table,  processes_completed