'Execute a block, or store it in a variable, per the user\'s request.'

def store_or_execute(self, block, name):

    if name:
        self.shell.user_ns[name] = SList(block.splitlines())
        print ("Block    assigned    to    '%s'" % name)
    else:
        b = self.preclean_input(block)
        self.shell.user_ns['pasted_block'] = b
        self.shell.using_paste_magics = True
        try:
            self.shell.run_cell(b)
        finally:
            self.shell.using_paste_magics = False
