class_docstr: A set of magics useful when controlling a parallel IPython cluster.
docstr: Executes the cell in parallel.
  
  Examples
  --------
  ::
  
      In [24]: %%px --noblock
         ....: a = os.getpid()
      Async parallel execution on engine(s): all
  
      In [25]: %%px
         ....: print a
      [stdout:0] 1234
      [stdout:1] 1235
      [stdout:2] 1236
      [stdout:3] 1237
docstr_tok: ["Executes","the","cell","in","parallel",".","Examples","--","--","--","--",":",":","In","[","24","]",":","%","%","px","--","noblock","....",":","a","=","os.getpid","(",")","Async","parallel","execution","on","engine","(","s",")",":","all","In","[","25","]",":","%","%","px","....",":","print","a","[","stdout:0","]","1234","[","stdout:1","]","1235","[","stdout:2","]","1236","[","stdout:3","]","1237"]
code: def cell_px(self, line="", cell=None):
      """Executes the cell in parallel.
  
      Examples
      --------
      ::
  
          In [24]: %%px --noblock
             ....: a = os.getpid()
          Async parallel execution on engine(s): all
  
          In [25]: %%px
             ....: print a
          [stdout:0] 1234
          [stdout:1] 1235
          [stdout:2] 1236
          [stdout:3] 1237
      """
  
      args = magic_arguments.parse_argstring(self.cell_px, line)
  
      if args.targets:
          save_targets = self.view.targets
          self.view.targets = self._eval_target_str(args.targets)
      signal_on_interrupt = None
      if args.signal_on_interrupt:
          signal_on_interrupt = self._eval_signal_str(
              args.signal_on_interrupt
          )
      # if running local, don't block until after local has run
      block = False if args.local else args.block
      try:
          ar = self.parallel_execute(
              cell,
              block=block,
              groupby=args.groupby,
              save_name=args.save_name,
              stream_output=args.stream,
              progress_after=args.progress_after_seconds,
              signal_on_interrupt=signal_on_interrupt,
          )
      finally:
          if args.targets:
              self.view.targets = save_targets
  
      # run locally after submitting remote
      block = self.view.block if args.block is None else args.block
      if args.local:
          self.shell.run_cell(cell)
          # now apply blocking behavor to remote execution
          if block:
              ar.get()
              ar.display_outputs(args.groupby)
      if not block:
          return ar
  
imports: import time
  from contextlib import contextmanager
  import inspect
  import re
  import sys
  from textwrap import dedent
  from IPython.core import magic_arguments
  from IPython.core.error import UsageError
  from IPython.core.magic import Magics, no_var_expand
  import ipyparallel
  from ..None import error
label_desc: Use image node_id 8 for calling the ParallelMagics obj's underlying member method code with example usage: obj.cell_px(line, cell) and returns: ar