'Print (or run through pager) the file where an object is defined.
The debugger interface to %pfile.'

def do_pfile(self, arg):

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