code: def flush_region(self, region, mips=None):
      
      if not os.path.exists(self.path):
        return
      
      if type(region) in (list, tuple):
        region = generate_slices(region, self.vol.bounds.minpt, self.vol.bounds.maxpt, bounded=False)
        region = Bbox.from_slices(region)
  
      mips = self.vol.mip if mips == None else mips
      if type(mips) == int:
        mips = (mips, )
  
      for mip in mips:
        mip_path = os.path.join(self.path, self.vol.mip_key(mip))
        if not os.path.exists(mip_path):
          continue
  
        region_mip = self.vol.slices_from_global_coords(region)
        region_mip = Bbox.from_slices(region_mip)
  
        for filename in os.listdir(mip_path):
          bbox = Bbox.from_filename(filename)
          if not Bbox.intersects(region, bbox):
            os.remove(os.path.join(mip_path, filename))
docs: Delete a cache region at one or more mip levels 
      bounded by a Bbox for this dataset. Bbox coordinates
      should be specified in mip 0 coordinates.
  
      Required:
        region (Bbox): Delete cached chunks located partially
          or entirely within this bounding box. 
      Optional:
        mip (int: None): Flush the cache from this mip. Region
          is in global coordinates.
      
      Return: void