

def get_help(self, mtype, name, level=0):
    if hasattr(self, ((mtype + '_') + name)):
        func = getattr(self, ((mtype + '_') + name))
        if (level == 0):
            if func.__doc__:
                return _trim(func.__doc__)
            else:
                return ("No help available for magic '%s' for %ss." % (name, mtype))
        else:
            filename = inspect.getfile(func)
            if (filename and os.path.exists(filename)):
                return open(filename).read()
            else:
                return ("No help available for magic '%s' for %ss." % (name, mtype))
    else:
        return ("No such magic '%s' for %ss." % (name, mtype))

dataset/ETHPy150Open Calysto/metakernel/metakernel/magic.py Magic.get_help/original