code: def status_filters(fn):
      """### Filter by Run Status
  
      Runs may also be filtered by specifying one or more status
      filters: `--running`, `--completed`, `--error`, and
      `--terminated`. These may be used together to include runs that
      match any of the filters. For example to only include runs that
      were either terminated or exited with an error, use ``--terminated
      --error``, or the short form ``-Set``.
  
      You may combine more than one status character with ``-S`` to
      expand the filter. For example, ``-Set`` shows only runs with
      terminated or error status.
  
      Status filters are applied before `RUN` indexes are resolved. For
      example, a run index of ``1`` is the latest run that matches the
      status filters.
      """
      click_util.append_params(
          fn,
          [
              click.Option(
                  ("-Sr", "--running/--not-running", "status_running"),
                  help="Filter runs that are still running.",
                  is_flag=True,
                  default=None,
                  callback=_apply_status_chars,
              ),
              click.Option(
                  (
                      "-Sc",
                      "--completed/--not-completed",
                      "status_completed",
                  ),
                  help="Filter completed runs.",
                  is_flag=True,
                  default=None,
                  callback=_apply_status_chars,
              ),
              click.Option(
                  ("-Se", "--error/--not-error", "status_error"),
                  help="Filter runs that exited with an error.",
                  is_flag=True,
                  default=None,
                  callback=_apply_status_chars,
              ),
              click.Option(
                  (
                      "-St",
                      "--terminated/--not-terminated",
                      "status_terminated",
                  ),
                  help="Filter runs terminated by the user.",
                  is_flag=True,
                  default=None,
                  callback=_apply_status_chars,
              ),
              click.Option(
                  ("-Sp", "--pending/--not-pending", "status_pending"),
                  help="Filter pending runs.",
                  is_flag=True,
                  default=None,
                  callback=_apply_status_chars,
              ),
              click.Option(
                  ("-Ss", "--staged/--not-staged", "status_staged"),
                  help="Filter staged runs.",
                  is_flag=True,
                  default=None,
                  callback=_apply_status_chars,
              ),
              click.Option(
                  # Used by _apply_status_chars to implicitly set status
                  # flags using one or more chars.
                  ("-S", "status_chars"),
                  hidden=True,
                  callback=_validate_status_chars,
              ),
          ],
      )
      return fn
  
imports: import logging
  import click
  from guild import click_util
  from .None import ac_support
label_desc: Use image node_id 18 for calling a global function with example usage: status_filters(fn) and returns: fn