docstr: %%px with Keyboard Interrupt on blocking execution
code: def cellpx_keyboard_interrupt_test_helper(self, sig=None):
      """%%px with Keyboard Interrupt on blocking execution"""
      ip = get_ipython()
      v = self.client[:]
      v.block = True
      v.activate()
  
      def _sigalarm(sig, frame):
          raise KeyboardInterrupt
  
      signal.signal(signal.SIGALRM, _sigalarm)
      signal.alarm(2)
      with capture_output(display=False) as io:
          ip.run_cell_magic(
              "px",
              "" if sig is None else f"--signal-on-interrupt {sig}",
              "print('Entering...'); import time; time.sleep(5); print('Exiting...');",
          )
  
      print(io.stdout)
      print(io.stderr, file=sys.stderr)
      assert (
          "Received Keyboard Interrupt. Sending signal {} to engines...".format(
              "SIGINT" if sig is None else sig
          )
          in io.stderr
      )
      assert "Exiting..." not in io.stdout
  
imports: import re
  import signal
  import sys
  import time
  import pytest
  from IPython import get_ipython
  from IPython.utils.io import capture_output
  import ipyparallel
  from ipyparallel import AsyncResult
  from .clienttest import ClusterTestCase, generate_output, raises_remote
label_desc: Use image node_id 21 for calling the TestParallelMagics obj's underlying member method code with example usage: obj.cellpx_keyboard_interrupt_test_helper(sig) without return types