Delete the files within the bounding box.

    bbox_or_slices: accepts either a Bbox or a tuple of slices representing
      the requested volume.
773489
def delete(self, bbox_or_slices):
    
    if type(bbox_or_slices) is Bbox:
      requested_bbox = bbox_or_slices
    else:
      (requested_bbox, _, _) = self.__interpret_slices(bbox_or_slices)
    realized_bbox = self.__realized_bbox(requested_bbox)

    if requested_bbox != realized_bbox:
      raise exceptions.AlignmentError(
        "Unable to delete non-chunk aligned bounding boxes. Requested: {}, Realized: {}".format(
        requested_bbox, realized_bbox
      ))

    cloudpaths = txrx.chunknames(realized_bbox, self.bounds, self.key, self.underlying)
    cloudpaths = list(cloudpaths)

    with Storage(self.layer_cloudpath, progress=self.progress) as storage:
      storage.delete_files(cloudpaths)

    if self.cache.enabled:
      with Storage('file://' + self.cache.path, progress=self.progress) as storage:
        storage.delete_files(cloudpaths)
667257
def delete(self, *args, **kwargs):
        
        try:
            os.remove(self.file.file.name)
        # image does not exist
        except (OSError, IOError):
            pass
        super(Image, self).delete(*args, **kwargs)
780467
def container_remove_folder(object_id, input_params={}, always_retry=False, **kwargs):
    
    return DXHTTPRequest('/%s/removeFolder' % object_id, input_params, always_retry=always_retry, **kwargs)
1256915
def _delete_dir(dir):
    
    try:
        shutil.rmtree(dir)  # delete directory
    except OSError as exc:
        if exc.errno != 2:  # code 2 - no such file or directory
            raise  # re-raise exception
    except UnboundLocalError:
        pass
436000
def delete(self):
        
        disks = self.get_disks()
        self.domain.undefine()
        for disk in disks:
            disk.wipe()
            disk.delete()
831676
def delete_archive_dir(self):
        
        logger.debug("Deleting: " + self.archive_dir)
        shutil.rmtree(self.archive_dir, True)
1219791
def cleanup(self):
        

        all([delete_file_or_tree(f) for f in self.to_delete])
        self.to_delete = []
689938
def delete_files(paths):
    
    for path in paths:
        if os.path.exists(path):
            os.remove(path)
411141
def unmount(self, allow_lazy=False):
        

        for volume in self.volumes:
            try:
                volume.unmount(allow_lazy=allow_lazy)
            except ImageMounterError:
                pass

        if self.is_mounted:
            logger.info("Unmounting volume %s", self)

        if self.loopback and self.info.get('volume_group'):
            _util.check_call_(["lvm", 'vgchange', '-a', 'n', self.info['volume_group']],
                              wrap_error=True, stdout=subprocess.PIPE)
            self.info['volume_group'] = ""

        if self.loopback and self._paths.get('luks'):
            _util.check_call_(['cryptsetup', 'luksClose', self._paths['luks']], wrap_error=True, stdout=subprocess.PIPE)
            del self._paths['luks']

        if self._paths.get('bde'):
            try:
                _util.clean_unmount(['fusermount', '-u'], self._paths['bde'])
            except SubsystemError:
                if not allow_lazy:
                    raise
                _util.clean_unmount(['fusermount', '-uz'], self._paths['bde'])
            del self._paths['bde']

        if self._paths.get('md'):
            md_path = self._paths['md']
            del self._paths['md']  # removing it here to ensure we do not enter an infinite loop, will add it back later

            # MD arrays are a bit complicated, we also check all other volumes that are part of this array and
            # unmount them as well.
            logger.debug("All other volumes that use %s as well will also be unmounted", md_path)
            for v in self.disk.get_volumes():
                if v != self and v._paths.get('md') == md_path:
                    v.unmount(allow_lazy=allow_lazy)

            try:
                _util.check_output_(["mdadm", '--stop', md_path], stderr=subprocess.STDOUT)
            except Exception as e:
                self._paths['md'] = md_path
                raise SubsystemError(e)

        if self._paths.get('vss'):
            try:
                _util.clean_unmount(['fusermount', '-u'], self._paths['vss'])
            except SubsystemError:
                if not allow_lazy:
                    raise
                _util.clean_unmount(['fusermount', '-uz'], self._paths['vss'])
            del self._paths['vss']

        if self.loopback:
            _util.check_call_(['losetup', '-d', self.loopback], wrap_error=True)
            self.loopback = ""

        if self._paths.get('bindmounts'):
            for mp in self._paths['bindmounts']:
                _util.clean_unmount(['umount'], mp, rmdir=False)
            del self._paths['bindmounts']

        if self.mountpoint:
            _util.clean_unmount(['umount'], self.mountpoint)
            self.mountpoint = ""

        if self._paths.get('carve'):
            try:
                shutil.rmtree(self._paths['carve'])
            except OSError as e:
                raise SubsystemError(e)
            else:
                del self._paths['carve']

        self.is_mounted = False
760810
def delete_files!(dir)
      File.delete(to_path) while setup_path(dir) && File.exist?(to_path)
    end
1074850
def delete(self, ignore=None):
        """"""
        ignore = ignore or []

        def _delete(tree_or_filename, alias=None):
            """Delete indexes and aliases by walking DFS."""
            if alias:
                yield alias, self.client.indices.delete_alias(
                    index=list(_get_indices(tree_or_filename)),
                    name=alias,
                    ignore=ignore,
                )

            # Iterate over aliases:
            for name, value in tree_or_filename.items():
                if isinstance(value, dict):
                    for result in _delete(value, alias=name):
                        yield result
                else:
                    yield name, self.client.indices.delete(
                        index=name,
                        ignore=ignore,
                    )

        for result in _delete(self.active_aliases):
            yield result
397633
def delete_all_volumes(self):
        
        # Raise an exception if we are not a manager
        if not self._manager:
            raise RuntimeError('Volumes can only be deleted '
                               'on swarm manager nodes')

        volume_list = self.get_volume_list()
        for volumes in volume_list:
            # Remove all the services
            self._api_client.remove_volume(volumes, force=True)
753052
public void delete() {
    try {
      Files.deleteIfExists(file.file().toPath());
    } catch (IOException e) {
      throw new StorageException(e);
    }
  }
1077016
def delete_volume(self, volObj, removeMode='ONLY_ME', **kwargs):
        
        if kwargs:
            for key, value in kwargs.iteritems():
                if key =='autoUnmap' and value ==True:
                    # Find all mapped SDS to this volObj
                    # Call unmap for all of them
                    if self.get_volume_all_sdcs_mapped(volObj):
                        try:
                            self.conn.cluster.unmap_volume_from_sdc(volObj, enableMapAllSdcs=False)
                        except:
                            raise RuntimeError("delete_volume() - enableMapAllSdcs error")
                    else: # All SDS not enabled so loop through all mapped SDCs of volume and remove one by one                        
                        for sdc in self.get_sdc_for_volume(volObj):
                            try:
                                self.unmap_volume_from_sdc(volObj, self.get_sdc_by_id(sdc['sdcId']))
                            except:
                                raise RuntimeError("delete_volume() - unmap_volume_from_sdc() error")
        # TODO:
        # Check if object parameters are the correct ones, otherwise throw error
        self.conn.connection._check_login()
        deleteVolumeDict = {'removeMode': removeMode}
        try:
            response = self.conn.connection._do_post("{}/{}{}/{}".format(self.conn.connection._api_url, "instances/Volume::", volObj.id, 'action/removeVolume'), json=deleteVolumeDict)
        except:
            raise RuntimeError("delete_volume() - Communication error with ScaleIO Gateway")
        return response
809942
def bounding_box
      unless @bbox
        p = @points[0]
        minX = p[0]
        maxX = p[0]
        minY = p[1]
        maxY = p[1]
        minZ = p[2]
        maxZ = p[2]
        @points.each{|p|
          minX = p[0] if p[0] < minX  
          maxX = p[0] if p[0] > maxX  
          minY = p[1] if p[1] < minY  
          maxY = p[1] if p[1] > maxY  
          minZ = p[2] if p[2] < minZ  
          maxZ = p[2] if p[2] > maxZ  
        }
        @max = Vector[maxX, maxY,maxZ]
        @min = Vector[minX, minY, minZ]
        @bbox = Volume.new([Plane.new(-1,0,0, minX, minY, minZ), 
                           Plane.new(0,-1,0, minX, minY, minZ),
                           Plane.new(0,0,-1, minX, minY, minZ),
                           Plane.new(1,0,0, maxX, maxY, maxZ),
                           Plane.new(0,1,0, maxX, maxY, maxZ), 
                           Plane.new(0,0,1, maxX, maxY, maxZ)])
      end
      @bbox
    end
577643
def remove_folder(self, tree, prefix):
        
        while True:
            child = tree
            tree = tree.parent

            if not child.folders and not child.files:
                del self.cache[tuple(prefix)]
                if tree:
                    del tree.folders[prefix.pop()]

            if not tree or tree.folders or tree.files:
                break
1017693
def _Close(self):
    
    self._bde_volume.close()
    self._bde_volume = None

    self._file_object.close()
    self._file_object = None