code: def script_args(f):
      """single decorator for adding script args"""
      args = [
          magic_arguments.argument(
              "--out",
              type=str,
              help="""The variable in which to store stdout from the script.
              If the script is backgrounded, this will be the stdout *pipe*,
              instead of the stderr text itself and will not be auto closed.
              """,
          ),
          magic_arguments.argument(
              "--err",
              type=str,
              help="""The variable in which to store stderr from the script.
              If the script is backgrounded, this will be the stderr *pipe*,
              instead of the stderr text itself and will not be autoclosed.
              """,
          ),
          magic_arguments.argument(
              "--bg",
              action="store_true",
              help="""Whether to run the script in the background.
              If given, the only way to see the output of the command is
              with --out/err.
              """,
          ),
          magic_arguments.argument(
              "--proc",
              type=str,
              help="""The variable in which to store Popen instance.
              This is used only when --bg option is given.
              """,
          ),
          magic_arguments.argument(
              "--no-raise-error",
              action="store_false",
              dest="raise_error",
              help="""Whether you should raise an error message in addition to
              a stream on stderr if you get a nonzero exit code.
              """,
          ),
      ]
      for arg in args:
          f = arg(f)
      return f
  
imports: import asyncio
  import asyncio.exceptions
  import atexit
  import errno
  import os
  import signal
  import sys
  import time
  from subprocess import CalledProcessError
  from threading import Thread
  from traitlets import Any, Dict, List, default
  from IPython.core import magic_arguments
  from IPython.core.async_helpers import _AsyncIOProxy
  from IPython.core.magic import Magics, cell_magic, line_magic, magics_class
  from IPython.utils.process import arg_split
label_desc: Use image node_id 1 for calling a global function with example usage: script_args(f) and returns: f