'Print (or run through pager) the source code for an object.'

def do_psource(self, arg):

    namespaces = [('Locals', self.curframe.f_locals), ('Globals', self.curframe.f_globals)]
    self.shell.find_line_magic('psource')(arg, namespaces=namespaces)
