Discard from original file.
323237
def discard(self, s):
        

        lines = s.splitlines(True)
        for line in lines:
            if line[-1] not in '\r\n':
                if not self.warn:
                    logger.warning(
                        'partial line discard UNSUPPORTED; source map '
                        'generated will not match at the column level'
                    )
                    self.warn = True
            else:
                # simply increment row
                self.row += 1
15533
def discard(self, key):
        
        if key in self:
            i = self.map[key]
            del self.items[i]
            del self.map[key]
            for k, v in self.map.items():
                if v >= i:
                    self.map[k] = v - 1
902096
def remove(self):
        """"""
        if self.exists() or self.islink():
            self.fs.unlink(self.get_internal_path())
            return 1
        return None
931807
def purge(root=os.path.join(base.data_dir(), 'models')):
    
    """
    root = os.path.expanduser(root)
    files = os.listdir(root)
    for f in files:
        if f.endswith(".params"):
            os.remove(os.path.join(root, f))
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))
836388
def removeDuplicates(inFileName, outFileName) :
	"""'"""
	f = open(inFileName)
	legend = f.readline()
	
	data = ''
	h = {}
	h[legend] = 0
	
	lines = f.readlines()
	for l in lines :
		if not h.has_key(l) :
			h[l] = 0
			data += l
			
	f.flush()
	f.close()
	f = open(outFileName, 'w')
	f.write(legend+data)
	f.flush()
	f.close()
1004324
def close(self):
        """"""

        super(RarExtFile, self).close()

        if self._fd:
            self._fd.close()
            self._fd = None
1053834
def delete(cls, filename, offset=None):
        """"""
        with fileutil.opened(filename, "rb+") as file:
            if offset is None:
                file.seek(-128, 2)
            else:
                file.seek(offset)
            offset = file.tell()
            data = file.read(128)
            if data[:3] == b"TAG":
                fileutil.replace_chunk(file, offset, 128, b"", in_place=True)
815817
def remove_file(self, name):
        """"""
        self.check_write(name)
        path = os.path.join(self.cur_dir, name)
        os.remove(path)
104573
def CleanUp(self, path):
    """"""
    try:
      if os.path.exists(path):
        os.remove(path)
    except (OSError, IOError) as e:
      logging.info("Failed to remove temporary file %s. Err: %s", path, e)
26878
def delete_file(self, filename):
        """"""
        log.info("deleting %s", filename)
        if not self.dry_run:
            os.unlink(filename)
215511
def _discard_config(self):
        """"""
        discard_candidate = "copy running-config {}".format(
            self._gen_full_path(self.candidate_cfg)
        )
        discard_merge = "copy null: {}".format(self._gen_full_path(self.merge_cfg))
        self.device.send_command_expect(discard_candidate)
        self.device.send_command_expect(discard_merge)
186050
private boolean discardDone(INodeFileUnderConstruction pendingFile,
                              String src) throws IOException {
    Block[] blocks = pendingFile.getBlocks();
    if (blocks == null || blocks.length == 0) {
      return false;
    }
    Block last = blocks[blocks.length-1];
    if (last.getNumBytes() == 0) {
      dir.removeBlock(src, pendingFile, last);
      finalizeINodeFileUnderConstruction(src, pendingFile);
      NameNode.stateChangeLog.warn("BLOCK*" +
          " internalReleaseLease: discarded last block " + last +
          " , lease removed for " +  src);
      return true;
    }
    return false;
  }
421397
def clean_up(group, identifier, date):
    
    #log.error('exception raised, cleaning up files.')
    glob_pat = '{g}.{d}.mbox*'.format(g=group, d=date)
    for f in glob(glob_pat):
        #log.error('removing {f}'.format(f=f))
        try:
            os.remove(f)
        except OSError:
            continue
    glob_pat = '{id}_state.json'.format(id=identifier)
    for f in glob(glob_pat):
        #log.error('removing {f}'.format(f=f))
        try:
            os.remove(f)
        except OSError:
            continue
    return True
34655
def cleanup(self):
        """"""
        if self.image:
            try:
                self.image.close()
            except Exception:
                pass
        if (self.outtmp is not None):
            try:
                os.unlink(self.outtmp)
            except OSError as e:
                self.logger.warning("Failed to cleanup tmp output file %s"
                                    % (self.outtmp))
1100382
def _removeLru(self):
        
        (dataFile, handle) = self._cache.pop()
        handle.close()
        return dataFile
66670
def remove(self, filename):
        """"""
        if self.list.pop(filename, None):
            self.modified_list = True
        if self.target.peer:  # otherwise `scan` command
            if self.target.is_local():
                remote_target = self.target.peer
                if remote_target.get_id() in self.dir["peer_sync"]:
                    rid = remote_target.get_id()
                    self.modified_sync = bool(
                        self.dir["peer_sync"][rid].pop(filename, None)
                    )
        return