class_docstr: Magics for talking to scripts
  
  This defines a base `%%script` cell magic for running a cell
  with a program in a subprocess, and registers a few top-level
  magics that call %%script with common interpreters.
class_docstr_tok: ["Magics","for","talking","to","scripts","This","defines","a","base","`","%","%","script","`","cell","magic","for","running","a","cell","with","a","program","in","a","subprocess",",","and","registers","a","few","top-level","magics","that","call","%","%","script","with","common","interpreters","."]
docstr: make a named magic, that calls %%script with a particular program
docstr_tok: ["make","a","named","magic",",","that","calls","%","%","script","with","a","particular","program"]
code: def _make_script_magic(self, name):
      """make a named magic, that calls %%script with a particular program"""
      # expand to explicit path if necessary:
      script = self.script_paths.get(name, name)
  
      @magic_arguments.magic_arguments()
      @script_args
      def named_script_magic(line, cell):
          # if line, add it as cl-flags
          if line:
              line = "%s %s" % (script, line)
          else:
              line = script
          return self.shebang(line, cell)
  
      # write a basic docstring:
      named_script_magic.__doc__ = """%%{name} script magic
          
          Run cells with {script} in a subprocess.
          
          This is a shortcut for `%%script {script}`
          """.format(
          **locals()
      )
  
      return named_script_magic
  
imports: from __future__ import print_function
  import errno
  import os
  import sys
  import signal
  import time
  from subprocess import Popen, PIPE
  import atexit
  from IPython.core import magic_arguments
  from IPython.core.magic import Magics, magics_class, line_magic, cell_magic
  from IPython.lib.backgroundjobs import BackgroundJobManager
  from IPython.utils import py3compat
  from IPython.utils.process import arg_split
  from traitlets import List, Dict, default
label_desc: Use image node_id 5 for calling the ScriptMagics obj's underlying member method code with example usage: obj._make_script_magic(name) and returns: named_script_magic, self