code: def _print_tags_for_group_by_tag(obj, group, runs, is_system):
      if not obj.is_quiet:
          # Pretty printing computations
          max_length = max([len(t) for t in runs] if runs else [0])
  
          all_runs = sorted(runs)
  
          num_runs = len(all_runs)
  
          # We consider 4 spaces in between columns, 120 characters total width, and
          # 120 >= column_count*max_length + (column_count - 1)*4
          column_count = 124 // (max_length + 4)
          if column_count == 0:
              # Make sure we have at least 1 column even for very, very long tags
              column_count = 1
              words_per_column = num_runs
          else:
              words_per_column = (
                  num_runs + column_count - 1
              ) // column_count
  
          # Extend all_runs by empty runs to be able to easily fill up the lines
          addl_runs = words_per_column * column_count - num_runs
          if addl_runs > 0:
              all_runs.extend([" " for _ in range(addl_runs)])
  
          lines = []
          lines.append(
              "For tag %s" % (group if is_system else "*%s*" % group)
          )
          for i in range(words_per_column):
              line_values = [
                  all_runs[i + j * words_per_column]
                  for j in range(column_count)
              ]
              length_values = [max_length for l in line_values]
              formatter = "    ".join(
                  ["{:<%d}" % l for l in length_values]
              )
              lines.append(formatter.format(*line_values))
          lines.append("")
          obj.echo("\n".join(lines), err=False)
      else:
          # In quiet mode, we display things much more simply so it is parseable.
          # When displaying by tag, we output twp columns:
          #  - the tag (user:<tag> or sys:<tag>)
          #  - the comma separated list of runs
          # Columns are separated by a semicolon surrounded by a space on each side
          # to make it consistent with the by_run listing
          obj.echo_always(
              " ; ".join(
                  [
                      "system:%s" % group
                      if is_system
                      else "user:%s" % group,
                      ",".join(runs),
                  ]
              )
          )
  
imports: import sys
  from itertools import chain
  from metaflow import namespace
  from metaflow.client import Flow, Run
  from metaflow.current import current
  from metaflow.util import resolve_identity
  from metaflow.exception import CommandException, MetaflowNotFound, MetaflowInternalError
  from metaflow.exception import MetaflowNamespaceMismatch
  from metaflow._vendor import click
label_desc: Use image node_id 3 for calling a global function with example usage: _print_tags_for_group_by_tag(obj, group, runs, is_system) without return types