Deletes file_ references in Key Value store and optionally the file_
        it self.
432747
def delete(self, file_, delete_file=True):
        
        image_file = ImageFile(file_)
        if delete_file:
            image_file.delete()
        default.kvstore.delete(image_file)
919841
public void cleanUpNullReferences() {
        final Iterator<Map.Entry<Object, Object>> iterator = cache.entrySet().iterator();
        while (iterator.hasNext()) {
            final Map.Entry<Object, Object> entry = iterator.next();
            Object entryVal = entry.getValue();
            if (entryVal != null && ((SoftReference) entryVal).get() == null) cache.remove(entry.getKey(), entryVal);
        }
    }
79004
def release_references(self, keys):
        
        keys = set(self.referenced_by) & set(keys)
        for key in keys:
            self.referenced_by.pop(key)
1129170
def _cleanup(self):  # pragma: no cover
        
        need_to_delete = []  # can't delete from a dict while iterating
        with self.attr_lock:
            now_time = time()
            for path in self.cache:
                if now_time - self.attr[path][TIMESTAMP_KEY] >= MAX_CACHE_TIME:
                    need_to_delete.append(path)
            for path in need_to_delete:
                del self.attr[path]
                del self.cache[path]
1189951
def remove_unnecessary_cache_files!
      current_keys = cache_files.map do |file|
        get_cache_key_from_filename(file)
      end
      inmemory_keys = responses.keys

      unneeded_keys = current_keys - inmemory_keys
      unneeded_keys.each do |key|
        File.unlink(filepath_for(key))
      end
    end
689212
def delete(self, key, **opts):
        """"""
        key, store = self._expand_opts(key, opts)
        try:
            del store[key]
        except KeyError:
            pass
896980
public void cleanReferenceCache() {
        final long now = currentDateSupplier.get().getTime();
        final Iterator<HardReference> it = hardReferences.iterator();
        while (it.hasNext()) {
            if (it.next().keeptSince.getTime() + REFERENCE_KEEPING_TIME <= now) {
                it.remove();
            }
        }
    }
779031
def DeleteSignedBinaryReferences(self,
                                   binary_id,
                                   cursor=None):
    """"""
    cursor.execute(
        """
      DELETE FROM signed_binary_references
      WHERE binary_type = %s AND binary_path_hash = %s
    """, [
        binary_id.binary_type.SerializeToDataStore(),
        mysql_utils.Hash(binary_id.path)
    ])
1297476
public void clear() {
        sourceWaterMarkMap.clear();
        flush();
        if (fileOriginal != null && fileOriginal.exists()) {
            fileOriginal.delete();
        }
    }
242915
public void cleanup() {
        if (file != null && file.exists() && !file.delete()) {
            LOGGER.debug("Failed to delete first temporary file {}", file.toString());
            file.deleteOnExit();
        }
    }
252655
def _cleanup(self):
        """"""
        self._expkg = None
        self._extmp = None
        self._flag_e = True
        self._ifile.close()
741219
void cleanUp() {
    if (threadStarted) {
      return;
    }

    Reference<?> reference;
    while ((reference = queue.poll()) != null) {
      /*
       * This is for the benefit of phantom references. Weak and soft
       * references will have already been cleared by this point.
       */
      reference.clear();
      try {
        ((FinalizableReference) reference).finalizeReferent();
      } catch (Throwable t) {
        logger.log(Level.SEVERE, "Error cleaning up after reference.", t);
      }
    }
  }
437069
public function clearAll()
    {
        $path  = $this->getFilePath();
        $files = glob($path . '*' . $this->fileExtension);

        foreach ($files as $file)
        {
            @unlink($file);
        }

        static::$keys = [];
    }
712050
private void clean() {
        Iterator<Entry<K, WeakReference<V>>> iter = entrySet().iterator();
        while (iter.hasNext()) {
            Entry<K, WeakReference<V>> e = iter.next();
            if (e != null && e.getValue() != null
                && e.getValue().get() == null) {
                iter.remove();
            }
        }
    }
88611
protected synchronized void clearResults() {
        filesIncluded    = new Vector();
        filesNotIncluded = new Vector();
        filesExcluded    = new Vector();
        filesDeselected  = new Vector();
        dirsIncluded     = new Vector();
        dirsNotIncluded  = new Vector();
        dirsExcluded     = new Vector();
        dirsDeselected   = new Vector();
        everythingIncluded = (basedir != null);
        scannedDirs.clear();
    }
247016
def delete(self, record_key):

        ''' 
        '''

        title = '%s.delete' % self.__class__.__name__
        key_arg = '%s(record_key="%s")' % (title, record_key)

    # validate inputs
        record_key = self.fields.validate(record_key, '.record_key')

    # construct path to file
        file_path = os.path.join(self.collection_folder, record_key)

    # validate existence of file
        if not os.path.exists(file_path):
            exit_msg = '%s does not exist.' % record_key
            return exit_msg
    
    # delete file asynchronously
    #     if non_blocking:
    #         self._delete(file_path, title, record_key)
    #         exit_msg = '%s will be deleted.' % record_key
    #         return exit_msg
        
    # remove file
        current_dir = os.path.split(file_path)[0]
        try:
            os.remove(file_path)
        except:
            raise Exception('%s failed to delete %s' % (key_arg, record_key))

    # # remove empty directories in path to file
    #     if not os.listdir(current_dir):
    #         os.removedirs(current_dir)

    # remove empty directories in path to file
        while current_dir != self.collection_folder:
            if not os.listdir(current_dir):
                os.rmdir(current_dir)
                current_dir = os.path.split(current_dir)[0]
            else:
                break

        exit_msg = '%s has been deleted.' % record_key
        return exit_msg
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));
    }
  }