Cleanup our snapshots.
965838
def cleanup_snapshots(droplet, size) # rubocop:disable Metrics/AbcSize
      return unless size > keep

      warning_size(droplet.id, droplet.name, size)

      logger.debug "Cleaning up snapshots for droplet id: #{droplet.id} name: #{droplet.name}."

      api.cleanup_snapshots(droplet, size - keep - 1)
    rescue => e
      raise SnapshotCleanupError, e.message, e.backtrace
    end
602904
def cleanup(self):
        
        pb = self._get_ansible_playbook(self.playbooks.cleanup)
        pb.execute()
1080741
def cleanup(self):
        """"""
        self.parser = None
        self.request = None
        self.url = None
        self.headers = None
        self._request_handler_task = None
        self._request_stream_task = None
        self._total_request_size = 0
        self._is_stream_handler = False
1090803
def cleanup(self):
        """"""
        shutil.rmtree(self.name, onerror=lambda *a: os.chmod(a[1], __import__('stat').S_IWRITE) or os.unlink(a[1]))
        if os.path.exists(self.name):
            raise IOError(17, "File exists: '{}'".format(self.name))
507042
function cleanup()
    {
        $this->HTTP->removeSessionVariable( $this->StorageName . $this->MetaDataName );
        $this->HTTP->removeSessionVariable( $this->StorageName . $this->VariableListName );
        $this->MetaData = array();
        $this->VariableList = array();
    }
296301
def cleanup(self):
        """"""
        for file in glob.glob(self.basename + '*'):
            os.unlink(file)
133803
def cli(env, snapshot_id):
    """"""
    block_manager = SoftLayer.BlockStorageManager(env.client)
    deleted = block_manager.delete_snapshot(snapshot_id)

    if deleted:
        click.echo('Snapshot %s deleted' % snapshot_id)
60158
def clearData(self):
        """"""
        self._counts = np.zeros_like(self._bins)
        self.histo.setOpts(height=self._counts)
579070
def cleanup(self):
        
        for key in self._find_keys(identity='image'):
            image_file = self._get(key)

            if image_file and not image_file.exists():
                self.delete(image_file)

        for key in self._find_keys(identity='thumbnails'):
            # We do not need to check for file existence in here since we
            # already did that above for all image references
            image_file = self._get(key)

            if image_file:
                # if there is an image_file then we check all of its thumbnails
                # for existence
                thumbnail_keys = self._get(key, identity='thumbnails') or []
                thumbnail_keys_set = set(thumbnail_keys)

                for thumbnail_key in thumbnail_keys:
                    if not self._get(thumbnail_key):
                        thumbnail_keys_set.remove(thumbnail_key)

                thumbnail_keys = list(thumbnail_keys_set)

                if thumbnail_keys:
                    self._set(key, thumbnail_keys, identity='thumbnails')
                    continue

            # if there is no image_file then this thumbnails key is just
            # hangin' loose, If the thumbnail_keys ended up empty there is no
            # reason for keeping it either
            self._delete(key, identity='thumbnails')
1305758
public void cleanup() {
    htDictionary.clear();
    memoryEstimate.decrementTotalMemory(byteArray.getSizeInBytes());
    memoryEstimate.decrementTotalMemory(getSizeOfIntArrays());
    memoryEstimate.decrementDictionaryMemory(byteArray.size());
  }
443861
protected function cleanup()
    {
        $this->filesystem->remove($this->tmpFolder);
        $this->root = null;
        $this->urlsets = array();
    }
583549
def cleanup(self):
        
        if self._movie is not None:
            self._movie.frameChanged.disconnect(self._updateFrame)
            self._movie = None
1051308
def clean_up(self):
        '''  '''
        self.socket.close()
        for h in self.capture_handlers:
            h['logger'].close()
584724
private void cleanup() {

        m_folder1Exclusive = null;
        m_folder2Exclusive = null;
        m_foldersSibling = null;
        m_foldersEqualnames = null;
        m_foldersDifferenttypes = null;
    }
252655
def _cleanup(self):
        """"""
        self._expkg = None
        self._extmp = None
        self._flag_e = True
        self._ifile.close()
929355
public function cleanup()
    {
        if ($this->isEnabled() && $this->hasPattern() && realpath($this->installDir)) {
            $paths = iterator_to_array($this->finder->in($this->installDir));

            /** @var \SplFileInfo $path */
            foreach ($paths as $path) {
                $this->filesystem->remove($path);
            }
        }
    }
958339
def cleanup():
    """"""
    for sck in list(Wdb._sockets):
        try:
            sck.close()
        except Exception:
            log.warn('Error in cleanup', exc_info=True)