Clear cached images
7189
protected function clearCacheImageStyle()
    {
        $this->controlToken('clear');
        $style_id = $this->getQuery('clear');

        if (!empty($style_id)) {

            if ($this->image_style->clearCache($style_id)) {
                $this->redirect('', $this->text('Cache has been deleted'), 'success');
            }

            $this->redirect('', $this->text('Cache has not been deleted'), 'warning');
        }
    }
1033218
def clear_pictures(self):
        """"""

        blocks = [b for b in self.metadata_blocks if b.code != Picture.code]
        self.metadata_blocks = blocks
774050
function() {
    // Cleans all cache files
    if (fs.existsSync(this.dir)) {
      var files = fs.readdirSync(this.dir);

      files.forEach(function(file) {
        fs.unlinkSync(path.join(this.dir, file));
      }.bind(this));
    }
  }
491085
def clear_cached_values(self):
        
        self._prof_interp = None
        self._prof_y = None
        self._prof_z = None
        self._marg_interp = None
        self._marg_z = None
        self._post = None
        self._post_interp = None
        self._interp = None
        self._ret_type = None
1208119
function purgeCacheIfNecessary () {
  // If max cache size has not been exceeded, do nothing
  if (cacheSizeInBytes <= maximumSizeInBytes) {
    return;
  }

  // Cache size has been exceeded, create list of images sorted by timeStamp
  // So we can purge the least recently used image
  function compare (a, b) {
    if (a.timeStamp > b.timeStamp) {
      return -1;
    }
    if (a.timeStamp < b.timeStamp) {
      return 1;
    }

    return 0;
  }
  cachedImages.sort(compare);

  // Remove images as necessary)
  while (cacheSizeInBytes > maximumSizeInBytes) {
    const lastCachedImage = cachedImages[cachedImages.length - 1];
    const imageId = lastCachedImage.imageId;

    removeImageLoadObject(imageId);

    triggerEvent(events, EVENTS.IMAGE_CACHE_PROMISE_REMOVED, { imageId });
  }

  const cacheInfo = getCacheInfo();

  triggerEvent(events, EVENTS.IMAGE_CACHE_FULL, cacheInfo);
}
979403
public function clear()
    {
        $finder = new Finder();

        /** @var \Symfony\Component\Finder\SplFileInfo $file */
        foreach ($finder->files()->in($this->cacheDir)->depth(0)->name(self::CACHE_PATH_REGEX) as $file) {
            @unlink($file->getRealPath());
        }
    }
114827
public static function clearCache()
    {
        $tempDirectory = \OxidEsales\Eshop\Core\Registry::get(\OxidEsales\Eshop\Core\ConfigFile::class)->getVar("sCompileDir");
        $mask = $tempDirectory . "/" . self::CACHE_FILE_PREFIX . ".*.txt";
        $files = glob($mask);
        if (is_array($files)) {
            foreach ($files as $file) {
                if (is_file($file)) {
                    @unlink($file);
                }
            }
        }
    }
470772
public void clearAll() {
    final List<EncodedImage> old;
    synchronized (this) {
      old = new ArrayList<>(mMap.values());
      mMap.clear();
    }
    for (int i = 0; i < old.size(); i++) {
      EncodedImage encodedImage = old.get(i);
      if (encodedImage != null) {
        encodedImage.close();
      }
    }
  }
1141188
protected function delete_image() {
    $presets = $this->get_presets();

    foreach ($presets as $key => $preset) {
      $file_name = $this->imagecache_path . $key .'/'. $this->file_name;
      if (File::exists($file_name)) {
        File::delete($file_name);
      }
    }
  }
1116417
def clear_cache(m, files_processed):
    

    for what, reason, url, path in files_processed:
        cp = m.doc.downloader.cache_path(url)

        if m.cache.exists(cp):
            m.cache.remove(cp)
260165
def clearCache(self):
        ''
        for attr in self.cacheItems:
            if hasattr(self, attr):
                delattr(self, attr)
157973
public static function clearAll()
    {
        $dir = new \DirectoryIterator(static::config('directory'));

        foreach ($dir as $fileinfo) {

            if ($fileinfo->isFile()) {
                $cacheKey = $fileinfo->getFilename();
                static::clear($cacheKey);
            }
        }
    }
783244
private function cleanPaths()
    {
        $this->output->writeln('');


        if ($this->input->getOption('purge')) {
            $this->output->writeln('<magenta>Purging old cache</magenta>');
            $this->output->writeln('');

            $msg = Cache::purgeJob();
            $this->output->writeln($msg);
        } else {
            $this->output->writeln('<magenta>Clearing cache</magenta>');
            $this->output->writeln('');

            if ($this->input->getOption('all')) {
                $remove = 'all';
            } elseif ($this->input->getOption('assets-only')) {
                $remove = 'assets-only';
            } elseif ($this->input->getOption('images-only')) {
                $remove = 'images-only';
            } elseif ($this->input->getOption('cache-only')) {
                $remove = 'cache-only';
            } elseif ($this->input->getOption('tmp-only')) {
                $remove = 'tmp-only';
            } elseif ($this->input->getOption('invalidate')) {
                $remove = 'invalidate';
            } else {
                $remove = 'standard';
            }

            foreach (Cache::clearCache($remove) as $result) {
                $this->output->writeln($result);
            }
        }
    }
558678
public function clear()
    {
        $result = true;

        foreach (glob("{$this->path}/*.cache") as $filename) {
            if (!unlink($filename)) {
                $result = false;
            }
        }

        return $result;
    }
52376
def clear_cache():
        """"""
        del Cache._keys
        for k in list(Cache._cache.keys()):
            it = Cache._cache.pop(k)
            del it
        del Cache._cache
        Cache._keys = []
        Cache._cache = {}
        gc.collect()
523579
public void clearCache() {
        File cacheDir = getCacheDir();
        if (cacheDir.exists()) {
            File[] files = cacheDir.listFiles();
            if (files != null) {
                for (File child : files) {
                    deleteFilesRecursively(child);
                }
            }
        }
    }
1083500
def clear_imgs(self) -> None:
        ""
        self._preview_header.value = self._heading
        self._img_pane.children = tuple()