Get file list from ftp server filtered by taxon
        :return: Tuple of (Generator object with Tuple(
            file name, info object), ftp object)
969157
def _get_file_list(self, working_dir, file_regex=re.compile(r'.*'), ftp=None):
        

        if ftp is None:
            ftp = ftplib.FTP(BGEE_FTP)
            ftp.login("anonymous", "info@monarchinitiative.org")

        working_dir = "{}{}".format(self.version, working_dir)
        LOG.info('Looking for remote files in %s', working_dir)

        ftp.cwd(working_dir)
        remote_files = ftp.nlst()

        # LOG.info('All remote files \n%s', '\n'.join(remote_files))
        files_to_download = [
            dnload for dnload in remote_files if re.match(file_regex, dnload) and
            re.findall(r'^\d+', dnload)[0] in self.tax_ids]
        # LOG.info('Choosing remote files \n%s', '\n'.join(list(files_to_download)))

        return files_to_download, ftp
1093659
def GetFilePathsWithDialog(fileTypes=[]):
    
    root = tkinter.Tk()
    root.withdraw()
    filepath = filedialog.askopenfilenames(
        filetypes=fileTypes, parent=root)

    if isinstance(filepath, str):
        fileList = filepath.split(" ")
    elif isinstance(filepath, tuple):
        fileList = list(filepath)
    elif isinstance(filepath, list):
        fileList = filepath

    root.destroy()
    print(str(len(fileList)) + " files are selected")

    return fileList
118885
def listing(self):
        ""
        return ['.'.join([f,ext]) if ext else f for (f,ext) in self._files.keys()]
783646
def load_file_to_list(self):
        
        lst = []
        try:
            with open(self.fullname, 'r') as f:
                for line in f:
                    lst.append(line) 
            return lst  
        except IOError:
            return lst
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
1174955
def get_filter(filetypes, ext):
    """"""
    if not ext:
        return ALL_FILTER
    for title, ftypes in filetypes:
        if ext in ftypes:
            return _create_filter(title, ftypes)
    else:
        return ''
412752
def get_files(files, extnames=['.root']):
    """"""

    files_out = []
    for f in files:

        mime = mimetypes.guess_type(f)
        if os.path.splitext(f)[1] in extnames:
            files_out += [f]
        elif mime[0] == 'text/plain':
            files_out += list(np.loadtxt(f, unpack=True, dtype='str'))
        else:
            raise Exception('Unrecognized input type.')

    return files_out
561229
def list_files(self, node=None):
        

        return [file_node.path for file_node in self.list_file_nodes(node) if file_node.path]
196925
def file_names(self) -> Iterable[str]:
        
        if self.is_sharded():
            yield from ShardedFile(self.filename_spec).get_filenames()
        elif self.filename_spec:
            yield self.filename_spec
906958
private Map<String, Long> listFiles() throws FtpException {
		int attempts = 0;
		Map<String, Long> files = new LinkedHashMap<String, Long>();
		while (true){
			try {
				FTPListParseEngine engine = null;
				if (type.startsWith("UNIX")) {
					engine = ftpClient.initiateListParsing(FTPClientConfig.SYST_UNIX, null);
				} else {
					engine = ftpClient.initiateListParsing();
				}

				FTPFile[] list = engine.getFiles();
				if (list != null){
					for (FTPFile ftpFile : list){
						files.put(ftpFile.getName(), ftpFile.getSize());
					}
				}
				return files;
			} catch (Exception e) {
				attempts++;
				if (attempts > 3) {
					throw new FtpListFilesException(e);
				} else {
					LOGGER.trace("First attempt to get list of files FAILED! attempt={}", attempts);
				}
			}
		}
	}
1304015
def to_list(self):
        
        src = self._source or ''
        coll = self._collection or ''
        desc = self._description or ''

        l = [self._id, src, coll, self._name,
             ','.join(sorted(self._genes)), desc]
        return l
735270
def _getConfigFile(self, config):
        

        joinPath = lambda p: (os.path.join(p) if isinstance(p, (tuple, list)) else p)

        if self.filepathConfig is not None and self.filenameConfig is not None:
            if hasattr(config, self.filepathConfig) and hasattr(config, self.filenameConfig):
                path = joinPath(getattr(config, self.filepathConfig))
                name = getattr(config, self.filenameConfig)

                if os.path.isfile(os.path.join(path, name)):
                    return open(os.path.join(path, name), 'r')

        if self.filepath is not None and self.filename is not None:
            path = joinPath(self.filepath)
            name = self.filename

            if os.path.isfile(os.path.join(path, name)):
                return open(os.path.join(path, name), 'r')
271275
def fileids(self):
        
        return [os.path.join(self.path,i) for i in os.listdir(self.path)]
1359671
def get_files_types(self):
        
        for i in self.get_files():
            buffer = self.zip.read(i)
            self.files_crc32[i] = crc32(buffer)
            self.files[i] = "Unknown"
        return self.files
484854
def get_file_list(self, lstPaths, lstXtn, lstExcluded, VERBOSE = False):
        
        if VERBOSE:
            print("Generating list of Files...")
            print("Paths = ", lstPaths)
            print("Xtns  = ", lstXtn)
            print("exclude = ", lstExcluded)
        numFiles = 0
        self.filelist = []
        self.fl_metadata = []
        for rootPath in lstPaths:
            if VERBOSE:
                print(rootPath)
            for root, dirs, files in os.walk(rootPath):
                if VERBOSE:
                    print(dirs)
                for basename in files:
                    for xtn in lstXtn:
                        if fnmatch.fnmatch(basename, xtn):
                            filename = os.path.join(root, basename)
                            includeThisFile = "Y"
                            if len(lstExcluded) > 0:
                                for exclude in lstExcluded:
                                    if filename.find(exclude) != -1:
                                        includeThisFile = "N"
                            if includeThisFile == "Y":
                                numFiles = numFiles + 1
                                self.filelist.append(filename)
                                self.add_file_metadata(filename)    # not sure why there is a 2nd list, but there is.

        if VERBOSE:
            print("Found ", numFiles, " files")
        return self.filelist
100392
def filelists
      fl = []
      @repomd.xpath("/xmlns:repomd/xmlns:data[@type=\"filelists\"]/xmlns:location").each do |f|
       fl << File.join(@url, f['href'])
      end
      fl
    end
824697
def get_file_list(path, max_depth=1, cur_depth=0):
    
    if os.path.exists(path):
        for name in os.listdir(path):
            if name.startswith('.'):
                continue
            
            full_path = os.path.join(path, name)
            if os.path.isdir(full_path):
                if cur_depth == max_depth:
                    continue
                
                file_list = get_file_list(full_path, max_depth, cur_depth + 1)
                for result in file_list:
                    yield result
            else:
                yield full_path