code: def run_params(fn):
      click_util.append_params(
          fn,
          [
              click.Argument(
                  ("flags",),
                  metavar="[FLAG=VAL...]",
                  nargs=-1,
                  shell_complete=_ac_flag,
              ),
              click.Option(
                  ("-l", "--label"),
                  metavar="LABEL",
                  help="Set a label for the run.",
              ),
              click.Option(
                  ("-t", "--tag", "tags"),
                  metavar="TAG",
                  help="Associate TAG with run. May be used multiple times.",
                  multiple=True,
              ),
              click.Option(
                  ("-c", "--comment"),
                  metavar="COMMENT",
                  help="Comment associated with the run.",
              ),
              click.Option(
                  ("-ec", "--edit-comment"),
                  help="Use an editor to type a comment.",
                  is_flag=True,
              ),
              click.Option(
                  ("-e", "--edit-flags"),
                  help="Use an editor to review and modify flags.",
                  is_flag=True,
              ),
              click.Option(
                  ("-d", "--run-dir"),
                  metavar="DIR",
                  shell_complete=_ac_dir,
                  help=(
                      "Use alternative run directory DIR. Cannot be used with --stage."
                  ),
              ),
              click.Option(
                  ("--stage",), help="Stage an operation.", is_flag=True
              ),
              click.Option(
                  ("--start", "--restart", "restart"),
                  metavar="RUN",
                  help=(
                      "Start a staged run or restart an existing run. Cannot be "
                      "used with --proto or --run-dir."
                  ),
                  shell_complete=_ac_run,
              ),
              click.Option(
                  ("--proto",),
                  metavar="RUN",
                  help=(
                      "Use the operation, flags and source code from RUN. Flags may "
                      "be added or redefined in this operation. Cannot "
                      "be used with --restart."
                  ),
                  shell_complete=_ac_run,
              ),
              click.Option(
                  ("--force-sourcecode",),
                  is_flag=True,
                  help=(
                      "Use working source code when --restart or --proto is specified. "
                      "Ignored otherwise."
                  ),
              ),
              click.Option(
                  ("--gpus",),
                  metavar="DEVICES",
                  help=(
                      "Limit availabe GPUs to DEVICES, a comma separated list of "
                      "device IDs. By default all GPUs are available. Cannot be"
                      "used with --no-gpus."
                  ),
              ),
              click.Option(
                  ("--no-gpus",),
                  is_flag=True,
                  help="Disable GPUs for run. Cannot be used with --gpus.",
              ),
              click.Option(
                  ("-bl", "--batch-label"),
                  metavar="LABEL",
                  help="Label to use for batch runs. Ignored for non-batch runs.",
              ),
              click.Option(
                  ("-bt", "--batch-tag", "batch_tags"),
                  metavar="TAG",
                  help=(
                      "Associate TAG with batch. Ignored for non-batch runs. "
                      "May be used multiple times."
                  ),
                  multiple=True,
              ),
              click.Option(
                  ("-bc", "--batch-comment"),
                  metavar="COMMENT",
                  help="Comment associated with batch.",
              ),
              click.Option(
                  ("-ebc", "--edit-batch-comment"),
                  help="Use an editor to type a batch comment.",
                  is_flag=True,
              ),
              click.Option(
                  ("-o", "--optimizer"),
                  metavar="ALGORITHM",
                  help=(
                      "Optimize the run using the specified algorithm. See "
                      "Optimizing Runs for more information."
                  ),
              ),
              click.Option(
                  ("-O", "--optimize"),
                  is_flag=True,
                  help="Optimize the run using the default optimizer.",
              ),
              click.Option(
                  ("-N", "--minimize"),
                  metavar="COLUMN",
                  help=(
                      "Column to minimize when running with an optimizer. See "
                      "help for compare command for details specifying a column. "
                      "May not be used with --maximize."
                  ),
              ),
              click.Option(
                  ("-X", "--maximize"),
                  metavar="COLUMN",
                  help=(
                      "Column to maximize when running with an optimizer. See "
                      "help for compare command for details specifying a column. "
                      "May not be used with --minimize."
                  ),
              ),
              click.Option(
                  ("-Fo", "--opt-flag", "opt_flags"),
                  metavar="FLAG=VAL",
                  multiple=True,
                  help="Flag for OPTIMIZER. May be used multiple times.",
              ),
              click.Option(
                  ("-m", "--max-trials", "--trials"),
                  metavar="N",
                  type=click.IntRange(1, None),
                  help=(
                      "Maximum number of trials to run in batch operations. "
                      "Default is optimizer specific. If optimizer is not "
                      "specified, default is 20."
                  ),
              ),
              click.Option(
                  ("--random-seed",),
                  metavar="N",
                  type=int,
                  help="Random seed used when sampling trials or flag values.",
              ),
              click.Option(
                  ("--debug-sourcecode",),
                  metavar="PATH",
                  help=(
                      "Specify an alternative source code path for debugging. "
                      "See Debug Source Code below for details."
                  ),
              ),
              click.Option(
                  ("--stage-trials",),
                  is_flag=True,
                  help=(
                      "For batch operations, stage trials without running them."
                  ),
              ),
              remote_support.remote_option(
                  "Run the operation remotely."
              ),
              click.Option(
                  ("-y", "--yes"),
                  help="Do not prompt before running operation.",
                  is_flag=True,
              ),
              click.Option(
                  ("-f", "--force-flags"),
                  help=(
                      "Accept all flag assignments, even for undefined or "
                      "invalid values."
                  ),
                  is_flag=True,
              ),
              click.Option(
                  ("--force-deps",),
                  help=(
                      "Continue even when a required resource is not resolved."
                  ),
                  is_flag=True,
              ),
              click.Option(
                  ("--stop-after",),
                  metavar="N",
                  type=click_util.NUMBER,
                  help="Stop operation after N minutes.",
              ),
              click.Option(
                  ("--fail-on-trial-error",),
                  is_flag=True,
                  help="Stop batch operations when a trial exits with an error.",
              ),
              click.Option(
                  ("--needed",),
                  is_flag=True,
                  help=(
                      "Run only if there is not an available matching run. "
                      "A matching run is of the same operation with the same "
                      "flag values that is not stopped due to an error."
                  ),
              ),
              click.Option(
                  ("-b", "--background"),
                  is_flag=True,
                  help="Run operation in background.",
              ),
              click.Option(
                  ("--pidfile",),
                  metavar="PIDFILE",
                  help=(
                      "Run operation in background, writing the background process "
                      "ID to PIDFILE."
                  ),
              ),
              click.Option(
                  ("-n", "--no-wait"),
                  help=(
                      "Don't wait for a remote operation to complete. Ignored "
                      "if run is local."
                  ),
                  is_flag=True,
              ),
              click.Option(
                  ("--save-trials",),
                  metavar="PATH",
                  help=(
                      "Saves generated trials to a CSV batch file. See BATCH FILES "
                      "for more information."
                  ),
                  shell_complete=ac_support.ac_filename,
              ),
              click.Option(
                  ("--keep-run",),
                  is_flag=True,
                  help="Keep run even when configured with 'delete-on-success'.",
              ),
              click.Option(
                  ("--keep-batch",),
                  is_flag=True,
                  help="Keep batch run rather than delete it on success.",
              ),
              click.Option(
                  ("-D", "--dep", "additional_deps"),
                  metavar="PATH",
                  help=("Include PATH as a dependency."),
                  multiple=True,
                  shell_complete=ac_support.ac_filename,
              ),
              click.Option(
                  ("--break", "break_"),
                  metavar="LOCATION",
                  help=(
                      "Set a breakpoint at the specified location for Python based "
                      "operations. Set `LOCATION` to `1` to break at line 1 of the "
                      "main module. See Breakpoints above for `LOCATION` format. Use "
                      "multiple times for more than one breakpoint."
                  ),
                  multiple=True,
              ),
              click.Option(
                  ("--break-on-error",),
                  help=(
                      "Enter the Python debugger at the point an error occurs "
                      "for Python based operations."
                  ),
                  is_flag=True,
              ),
              click.Option(
                  ("-q", "--quiet"),
                  help="Do not show output.",
                  is_flag=True,
              ),
              click.Option(
                  ("--print-cmd",),
                  help="Show operation command and exit.",
                  is_flag=True,
              ),
              click.Option(
                  ("--print-env",),
                  help="Show operation environment and exit.",
                  is_flag=True,
              ),
              click.Option(
                  ("--print-trials",),
                  help="Show generated trials and exit.",
                  is_flag=True,
              ),
              click.Option(
                  ("--help-model",),
                  help="Show model help and exit.",
                  is_flag=True,
              ),
              click.Option(
                  ("-h", "--help-op"),
                  help="Show operation help and exit.",
                  is_flag=True,
              ),
              click.Option(
                  ("--test-output-scalars",),
                  metavar="OUTPUT",
                  help=(
                      "Test output scalars on output. Use '-' to read from standard "
                      "intput."
                  ),
              ),
              click.Option(
                  ("--test-output-attrs",),
                  metavar="OUTPUT",
                  help=(
                      "Test output attributes on output. Use '-' to read from standard "
                      "intput."
                  ),
              ),
              click.Option(
                  ("--test-sourcecode",),
                  help="Test source code selection.",
                  is_flag=True,
              ),
              click.Option(
                  ("--test-flags",),
                  help="Test flag configuration.",
                  is_flag=True,
              ),
              click.Option(("--run-id",), hidden=True),
          ],
      )
      return fn
  
imports: import click
  from guild import click_util
  from .None import ac_support
  from .None import remote_support
label_desc: Use image node_id 20 for calling a global function with example usage: run_params(fn) and returns: fn