code: def _format_table(rows: List[List[Optional[str]]]) -> str:
      """
      Formats a right justified table using None as column separator.
      """
      # compute column widths
      column_widths = [0, 0, 0]
      for row in rows:
          widths = [0, 0, 0]
          j = 0
          for cell in row:
              if cell is None:
                  j += 1
              else:
                  widths[j] += 1
          for j in range(3):
              column_widths[j] = max(column_widths[j], widths[j])
  
      # justify columns
      justified_rows: List[List[str]] = []
      for row in rows:
          cols: List[List[str]] = [[], [], []]
          j = 0
          for cell in row:
              if cell is None:
                  j += 1
              else:
                  cols[j].append(cell)
          cols = [
              [""] * (width - len(col)) + col
              if direction == "r"
              else col + [""] * (width - len(col))
              for width, col, direction in zip(
                  column_widths, cols, "rrl"
              )
          ]
          justified_rows.append(sum(cols, []))
  
      # compute cell widths
      cell_widths = [0] * len(justified_rows[0])
      for justified_row in justified_rows:
          for j, cell in enumerate(justified_row):
              cell_widths[j] = max(cell_widths[j], len(cell))
  
      # justify cells
      return "\n".join(
          " ".join(
              cell.rjust(width)
              for cell, width in zip(justified_row, cell_widths)
          )
          for justified_row in justified_rows
      )
  
imports: import sys
  from collections import OrderedDict
  from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List, Literal, Optional, Set, Tuple, Union
  import opt_einsum
  from pyro.distributions.score_parts import ScoreParts
  from pyro.distributions.util import scale_and_mask
  from pyro.ops.packed import pack
  from pyro.poutine.util import is_validation_enabled
  from pyro.util import warn_if_inf, warn_if_nan
label_desc: Use image node_id 2 for calling a global function with example usage: _format_table(rows) and returns: str