Return RarInfo for filename
435180
def getinfo(self, member):
        
        if isinstance(member, RarInfo):
            fname = member.filename
        else:
            fname = member

        # accept both ways here
        if PATH_SEP == '/':
            fname2 = fname.replace("\\", "/")
        else:
            fname2 = fname.replace("/", "\\")

        try:
            return self._info_map[fname]
        except KeyError:
            try:
                return self._info_map[fname2]
            except KeyError:
                raise NoRarEntry("No such file: %s" % fname)
998489
def getmember(self, name):
        
        tarinfo = self._getmember(name)
        if tarinfo is None:
            raise KeyError("filename %r not found" % name)
        return tarinfo
20124
def extract_file_name(content_dispo):
    """"""
    # print type(content_dispo)
    # print repr(content_dispo)
    # convertion of escape string (str type) from server
    # to unicode object
    content_dispo = content_dispo.decode('unicode-escape').strip('"')
    file_name = ""
    for key_val in content_dispo.split(';'):
        param = key_val.strip().split('=')
        if param[0] == "filename":
            file_name = param[1].strip('"')
            break
    return file_name
867453
function getFileInfo (fileName) {
    var result = {};
    result.name = fileName;
    result.exists = fs.existsSync (fileName);
    if (result.exists) {
        var stats = fs.statSync (fileName);
        result.isFile = stats.isFile ();
        result.isDirectory = stats.isDirectory ();
    }
    else {
        result.isFile = false;
        result.isDirectory = false;
    }
    
    return (result);
}
1039515
def _get_file_name_for_handle(handle):
    

    assert is_win
    assert handle != winapi.INVALID_HANDLE_VALUE

    size = winapi.FILE_NAME_INFO.FileName.offset + \
        winapi.MAX_PATH * ctypes.sizeof(winapi.WCHAR)
    buf = ctypes.create_string_buffer(size)

    if winapi.GetFileInformationByHandleEx is None:
        # Windows XP
        return None

    status = winapi.GetFileInformationByHandleEx(
        handle, winapi.FileNameInfo, buf, size)
    if status == 0:
        return None

    name_info = ctypes.cast(
        buf, ctypes.POINTER(winapi.FILE_NAME_INFO)).contents
    offset = winapi.FILE_NAME_INFO.FileName.offset
    data = buf[offset:offset + name_info.FileNameLength]
    return bytes2fsn(data, "utf-16-le")
175360
def file_contents(file_name):
    """"""
    curr_dir = os.path.abspath(os.path.dirname(__file__))
    with open(os.path.join(curr_dir, file_name)) as the_file:
        contents = the_file.read()
    return contents
446231
def filename(self):
        """"""
        if not self._ptr:
            raise BfdException("BFD not initialized")

        return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.FILENAME)
198145
def decorated_filename(filename, stat):
    
    mode = stat[0]
    if mode_isdir(mode):
        return DIR_COLOR + filename + END_COLOR + '/'
    if mode_issymlink(mode):
        return filename + '@'
    if filename.endswith('.py'):
        return PY_COLOR + filename + END_COLOR
    return filename
1174817
def filename(self):
        """"""
        if os.path.splitext(self.destination)[1]:
            # If the filename has been given make use of it
            target_file = self.destination
        else:
            # Otherwise determine it from the url.
            parsed_url = urlparse(self.url)
            source_filename = (parsed_url.path.rpartition('/')[-1] or
                               parsed_url.hostname)
            target_file = os.path.join(self.destination, source_filename)

        return os.path.abspath(target_file)
1373271
def filename_items_for_filetype(filenames, filetype_info):
        """"""
        matched_files = []
        for pattern in filetype_info['file_patterns']:
            for filename in match_filenames(filenames, pattern):
                if filename in matched_files:
                    continue
                try:
                    filename_info = parse(
                        pattern, get_filebase(filename, pattern))
                except ValueError:
                    logger.debug("Can't parse %s with %s.", filename, pattern)
                    continue
                matched_files.append(filename)
                yield filename, filename_info
1352279
def out_filename(template, n_val, mode):
    """"""
    return '{0}_{1}_{2}.cpp'.format(template.name, n_val, mode.identifier)
19498
def get_filename(self, index):
        """"""
        if index:
            path = self.fsmodel.filePath(self.proxymodel.mapToSource(index))
            return osp.normpath(to_text_string(path))
330359
def get_output_filename(args):
    """"""
    # If filename and path provided, use these for output text file.
    if args.directory is not None and args.fileprefix is not None:
        path = args.directory
        filename = args.fileprefix
        output = os.path.join(path, filename)
    # Otherwise, set output to current path
    elif args.fileprefix is not None:
        output = args.fileprefix
    else:
        output = args.pid
    return output
74412
def filename(value):
        '''
        
        '''
        return re.sub('[^a-zA-Z0-9.-_ ]', '', os.path.basename(InputSanitizer.trim(value)))
854488
private static String getFileName(String[] args)
	{
		String fileName = null;
		for (int i=0; i<args.length; i++)
		{
			if (!args[i].startsWith("-"))
			{
				fileName = args[i];
				break;
			}
		}
		return fileName;
	}
112542
def _readfname(fname):
    """"""
    try:
        if isinstance(fname, (file, StringIO)):
            astr = fname.read()
        else:
            astr = open(fname, 'rb').read()
    except NameError:
        if isinstance(fname, (FileIO, StringIO)):
            astr = fname.read()
        else:
            astr = mylib2.readfile(fname)
    return astr
1331241
def get_dirname(self, index):
        """"""
        fname = self.get_filename(index)
        if fname:
            if osp.isdir(fname):
                return fname
            else:
                return osp.dirname(fname)