@property
    def nicedir(self):
        try:
            from os.path import relpath, isabs
        except __HOLE__:
            return self.dir
        else:
            a = self.dir
            r = relpath(self.dir)
            if isabs(a):
                home = os.environ["HOME"]
                if a == home:
                    a = "~"
                elif a.startswith(home + os.sep):
                    a = "~" + a[len(home):]
            if len(r) < len(a):
                return r
            else:
                return a
dataset/ETHPy150Open trentm/sources/lib/sources.py/Source.nicedir