Delete the session and clear temporary directories
963702
def reset():
    
    shutil.rmtree(session['img_input_dir'])
    shutil.rmtree(session['img_output_dir'])
    session.clear()
    return jsonify(ok='true')
302378
def remove_directory(self, directory_name, *args, **kwargs):
		
		previous_path = self.session_path()
		try:
			self.session_path(directory_name)
			os.rmdir(self.full_path())
		finally:
			self.session_path(previous_path)
1301707
function cleanupTempFiles (options) {
  return new Promise((resolve, reject) => {
    if (options.tempDir) {
      if (path.dirname(options.sourceMap) === options.tempDir) {
        fs.unlinkSync(options.sourceMap)
      }
      fs.rmdir(options.tempDir, (err) => {
        if (err) {
          reject(err)
        } else {
          resolve()
        };
      })
    } else {
      resolve()
    }
  })
}
209425
def delete(self, file_path):
        """"""
        if os.sep in file_path:
            directory, file_name = file_path.rsplit(os.sep, 1)
            self.chdir(directory)
            return self.session.delete(file_name)

        else:
            return self.session.delete(file_path)
1287454
def close(self):
        

        if self.tmpdir:
            rmtree(self.tmpdir)
            self.tmpdir = None

        self._contents = None
242915
public void cleanup() {
        if (file != null && file.exists() && !file.delete()) {
            LOGGER.debug("Failed to delete first temporary file {}", file.toString());
            file.deleteOnExit();
        }
    }
69453
def clean(self):
        
        if self._initialized:
            logger.info("brace yourselves, removing %r", self.path)
            shutil.rmtree(self.path)
1200118
def _clean_dead_sessions(self):
        
        for sck in list(self.sessions.keys()):
            session = self.sessions[sck]
            if session.socket is None:
                del self.sessions[sck]
653679
def teardown_tempdir(dir):
    
    '''

    if ssh_conn:
        delete_tree(dir)

    assert_valid_dir(dir)
    shutil.rmtree(dir)
1063054
def clear_dir(self):
        """"""
        self.stdout.write("Deleting contents of '{}'.".format(self.destination_path))

        for filename in os.listdir(self.destination_path):
            if os.path.isfile(filename) or os.path.islink(filename):
                os.remove(filename)
            elif os.path.isdir(filename):
                shutil.rmtree(filename)
1132716
public function clear()
    {
        $this->session->remove($this->getSessionKey());
        $this->session->remove($this->getSessionExtraKey());
        $this->session->remove($this->getSessionTargetPathKey());
    }
798549
def _delete_dir(self):
        
        if not self.auto and os.path.isdir(self.meta.build_path + self.prgnam):
            shutil.rmtree(self.meta.build_path + self.prgnam)
1237819
def _cleanup_tempdir(tempdir):
    """"""
    try:
        shutil.rmtree(tempdir)
    except OSError as err:
        if err.errno != errno.ENOENT:
            raise
936617
def flush(self):
        

        self.clear()
        self.delete(self.session_key)
        self.create()
742767
def clear_dir(self):
        """"""
        for snapshot in output_utils.get_filenames(self.output_dir):
            if snapshot.endswith('.pkl'):
                os.remove(snapshot)
1303605
def _cleanup(self, domains):
        """"""
        for option in domains.values():
            try:
                os.remove(option['pot'])
            except (IOError, OSError):
                # It is not a problem if we can't actually remove the temporary file
                pass
659240
def delete_old_temp_folders
      path = File.join(Dir.tmpdir, STAGING_AREA_PREFIX + '*')

      day = 24 * 60 * 60
      dirs = Dir.glob(path)
      dirs.select! { |dir| Time.now.utc - File.ctime(dir).utc > day } # only stale ones
      removed = dirs.each { |dir| FileUtils.rm_rf(dir) }

      log "Removed #{removed} old temp folder(s)" if removed.count > 0
    end