def _try_remove(self, tdir, path, manifest=[]):
        fullpath = os.path.join(tdir, path)
        if fullpath in sys.path:
            return False
        if path in manifest:
            return False
        try:
            if os.path.isdir(fullpath):
                #  Remove paths starting with "esky" last, since we use
                #  these to maintain state information.
                esky_paths = []
                success = True
                for nm in os.listdir(fullpath):
                    if nm == "esky" or nm.startswith("esky-"):
                        esky_paths.append(nm)
                    else:
                        subdir = os.path.join(path, nm)
                        success &= self._try_remove(tdir, subdir, manifest)
                if not success:
                    return False
                for nm in sorted(esky_paths):
                    self._try_remove(tdir, os.path.join(path, nm), manifest)
                os.rmdir(fullpath)
            else:
                os.unlink(fullpath)
        except EnvironmentError, e:
            if e.errno not in self._errors_to_ignore:
                raise
            return False
        else:
            return True
Try to remove the file/directory at given path in the target dir.
dataset/ETHPy150Open cloudmatrix/esky/esky/__init__.py/Esky._try_remove