code: def _print_names_with_colors(
      names: List[str], colors: List[str], padding: int = 5
  ) -> None:
      console = Console()
      width = console.width
  
      max_L = max([len(name) for name in names] + [0]) + padding
  
      use_spacing = False
  
      if max_L * len(names) < width:
          use_spacing = True
  
      num_cols = width // max_L
  
      columns = {}
      for index, (name, color) in enumerate(zip(names, colors)):
          row = index // num_cols
          if row not in columns:
              columns[row] = []
          columns[row].append((name, color))
  
      for row_index in sorted(columns):
          row = ""
          for name, color in columns[row_index]:
              spacing = padding if use_spacing else max_L - len(name)
              spaces = " " * spacing
              row += _add_colors(name, color) + spaces
          rich.print(row)
  
imports: import contextlib
  import os
  import sys
  from contextlib import nullcontext
  from typing import Generator, List, Optional
  import click
  import lightning_cloud
  import rich
  from lightning_cloud.openapi import Externalv1LightningappInstance
  from rich.console import Console
  from rich.live import Live
  from rich.spinner import Spinner
  from rich.text import Text
  from lightning.app.cli.connect.app import _LIGHTNING_CONNECTION_FOLDER
  from lightning.app.utilities.app_helpers import Logger
  from lightning.app.utilities.cli_helpers import _error_and_exit
  from lightning.app.utilities.network import LightningClient
label_desc: Use image node_id 3 for calling a global function with example usage: _print_names_with_colors(names, colors, padding) without return types