code: def getdir(self, source):
          
          subdir = posixpath.join(self.pdir, source._tok)
          try:
              self.fs.rm(subdir, True)
          except Exception as e:
              logger.debug("Directory clear failed: %s" % e)
          self.fs.mkdirs(subdir)
          return subdir
docs: Clear/create a directory to store a persisted dataset into