parameters: (end_on_blank_line=False)
docstring: Captures & transforms cell magics.
      
      After a cell magic is started, this stores up any lines it gets until it is
      reset (sent None).
docstring_summary: Captures & transforms cell magics.
      
      After a cell magic is started, this stores up any lines it gets until it is
      reset (sent None).
docstring_tokens: Captures & transforms cell magics . After a cell magic is started this stores up any lines it gets until it is reset ( sent None ) .
function: def cellmagic(end_on_blank_line=False):
      """Captures & transforms cell magics.
      
      After a cell magic is started, this stores up any lines it gets until it is
      reset (sent None).
      """
      tpl = 'get_ipython().run_cell_magic(%r, %r, %r)'
      cellmagic_help_re = re.compile('%%\w+\?')
      line = ''
      while True:
          line = (yield line)
          # consume leading empty lines
          while not line:
              line = (yield line)
          
          if not line.startswith(ESC_MAGIC2):
              # This isn't a cell magic, idle waiting for reset then start over
              while line is not None:
                  line = (yield line)
              continue
          
          if cellmagic_help_re.match(line):
              # This case will be handled by help_end
              continue
          
          first = line
          body = []
          line = (yield None)
          while (line is not None) and \
                                  ((line.strip() != '') or not end_on_blank_line):
              body.append(line)
              line = (yield None)
          
          # Output
          magic_name, _, first = first.partition(' ')
          magic_name = magic_name.lstrip(ESC_MAGIC2)
          line = tpl % (magic_name, first, u'\n'.join(body))
function_tokens: def cellmagic ( end_on_blank_line = False ) : tpl = 'get_ipython().run_cell_magic(%r, %r, %r)' cellmagic_help_re = re . compile ( '%%\w+\?' ) line = '' while True : line = ( yield line ) # consume leading empty lines while not line : line = ( yield line ) if not line . startswith ( ESC_MAGIC2 ) : # This isn't a cell magic, idle waiting for reset then start over while line is not None : line = ( yield line ) continue if cellmagic_help_re . match ( line ) : # This case will be handled by help_end continue first = line body = [ ] line = ( yield None ) while ( line is not None ) and ( ( line . strip ( ) != '' ) or not end_on_blank_line ) : body . append ( line ) line = ( yield None ) # Output magic_name , _ , first = first . partition ( ' ' ) magic_name = magic_name . lstrip ( ESC_MAGIC2 ) line = tpl % ( magic_name , first , u'\n' . join ( body ) )