'Rerun a previously pasted command.'

def rerun_pasted(self, name='pasted_block'):

    b = self.shell.user_ns.get(name)
    if (b is None):
        raise UsageError('No    previous    pasted    block    available')
    if (not isinstance(b, str)):
        raise UsageError("Variable    'pasted_block'    is    not    a    string,    can't    execute")
    print ("Re-executing    '%s...'    (%d    chars)" % (b.split('\n', 1)[0], len(b)))
    self.shell.run_cell(b)
