:param File file: path to the file containing the player values in the standard
    CSV format used for fantasypros cheatsheets
    :return list(Player): a list of Players based on the info in the cheatsheet
558818
def players_from_fantasypros_cheatsheet(file):
    

    with open(file, newline='') as csvfile:
        # Note - considered using a generator for this, but I don't want to hold the file open
        # for a long time and it's pretty small anyway.
        players = []
        playerindex = 0
        playerreader = reader(csvfile, delimiter=',')
        linecount = 0
        for row in playerreader:
            if linecount > 1:
                raw_name = row[0]
                name = raw_name[:raw_name.find('(') - 1]
                position_text = raw_name[raw_name.find('(') + 1:raw_name.find('-') - 1]
                position = Position[position_text]
                value = int(row[2].replace('$', ''))
                players.append(Player(name, position, value, linecount-2))
                playerindex += 1
            linecount += 1
    return players
748454
def _get_roster(self):
        '''
        
        '''
        roster_file = salt.roster.get_roster_file(self.opts)
        if roster_file not in self.__parsed_rosters:
            roster_data = compile_template(roster_file, salt.loader.render(self.opts, {}),
                                           self.opts['renderer'], self.opts['renderer_blacklist'],
                                           self.opts['renderer_whitelist'])
            self.__parsed_rosters[roster_file] = roster_data
        return roster_file
1211974
public static File [] listFiles(File file) {
		if (file==null){
			return EMPTY_FILE_LIST;
		} 
		
		File ret[]=file.listFiles(FILE_FILTER);
		
		if (ret==null){
			return EMPTY_FILE_LIST;
		} else {
			return ret;
		}		
	}
636492
def to_csv(self, file: str, opts: dict = None) -> str:
        
        opts = opts if opts is not None else {}
        ll = self._is_valid()
        if ll:
            if not self.sas.batch:
                print(ll['LOG'])
            else:
                return ll
        else:
            return self.sas.write_csv(file, self.table, self.libref, self.dsopts, opts)
614861
def _set_player(self):
        
        players = []
        for name, p in self._mpris_players.items():
            # we set the priority here as we need to establish the player name
            # which might not be immediately available.
            if "_priority" not in p:
                if self.player_priority:
                    try:
                        priority = self.player_priority.index(p["name"])
                    except ValueError:
                        try:
                            priority = self.player_priority.index("*")
                        except ValueError:
                            priority = None
                else:
                    priority = 0
                if priority is not None:
                    p["_priority"] = priority
            if p.get("_priority") is not None:
                players.append((p["_state_priority"], p["_priority"], p["index"], name))
        if players:
            top_player = self._mpris_players.get(sorted(players)[0][3])
        else:
            top_player = {}

        self._player = top_player.get("_dbus_player")
        self._player_details = top_player

        self.py3.update()
1072364
def get_list_from_file(file_name):
    """"""
    with open(file_name, mode='r', encoding='utf-8') as f1:
        lst = f1.readlines()
    return lst
167363
private String[] list(File file) {
        String[] files = (String[]) fileListMap.get(file);
        if (files == null) {
            files = file.list();
            if (files != null) {
                fileListMap.put(file, files);
            }
        }
        return files;
    }
357033
def prepareList(self, listFile=False, noSample=False):
        

        logging.debug("Loading resolver file")

        listFileLocation = self.listLocal if not listFile else listFile

        # Resolve the user part of the path
        listLocal = os.path.expanduser(listFileLocation)

        # Check local file location exists and is writable
        assert os.path.isdir(os.path.dirname(listLocal)),\
            "{0} is not a directory!".format(os.path.dirname(listLocal))
        assert os.access(os.path.dirname(listLocal), os.W_OK),\
            "{0} is not writable!".format(os.path.dirname(listLocal))

        # Open and yaml parse the resolver list
        with open(listLocal) as ll:
            raw = ll.read()
            # Use safe_load, just to be safe.
            serverList = yaml.safe_load(raw)

        # Remove all but the specified countries from the server list
        if self.country is not None:
            logging.debug("Filtering serverList for country {0}"
                          .format(self.country))

            serverList = [d for d in serverList
                          if d['country'] == self.country]

            if len(serverList) == 0:
                raise ValueError("There are no servers avaliable "
                                 "with the country code {0}"
                                 .format(self.country))

        # Get selected number of servers
        if self.maxServers == 'ALL' or noSample:
            # Set servers to the number of servers we have
            self.maxServers = len(serverList)
        elif self.maxServers > len(serverList):
            # We were asked for more servers than exist in the list
            logging.warning(
                "You asked me to query {0} servers, but I only have "
                "{1} servers in my serverlist".format(
                    self.maxServers,
                    len(serverList)
                )
            )

            # Fallback to setting it to all
            self.maxServers = len(serverList)

        # Get a random selection of the specified number
        # of servers from the list
        self.serverList = random.sample(serverList, self.maxServers)

        return self.serverList
277492
function calcDependList(file) {
		calcing[file] = true;
		var reqs = file_req[file];
		if (reqs) {
			for (var i = 0, len = reqs.length, fi; i < len; i++) {
				fi = reqs[i];
				if (depended[fi] || calcing[fi]) {
					continue;
				}
				calcDependList(fi);
			}
		}
		all_depended[file] = depended[file] = true;

		var encoded_name = versions[file];
		if (encoded_name) {
			encoded_name = encoded_name[0];
		} else {
			encoded_name = last_file = addOne(last_file);
			versions[file] = [encoded_name, CURRENT_VER, '', file, 'new'];
		}
		depended_list.push(encoded_name);
	}
11128
public static List<String> readFileToLinesList( File file ) throws IOException {
        List<String> lines = new ArrayList<>();
        try (BufferedReader br = new BufferedReader(new FileReader(file))) {
            String line;
            while( (line = br.readLine()) != null ) {
                lines.add(line);
            }
            return lines;
        }
    }
948447
def to_list(self, csv_file):
        
        tolist = []
        for i in csv_file:
            i = [value.strip().replace(',', '') for value in i]
            try:
                for value in (1, 2, 3, 4, 5, 6, 8):
                    i[value] = float(i[value])
            except (IndexError, ValueError):
                pass
            tolist.append(i)
        if self._twse:
            if tolist:
                _stock_info = tolist[0][0].split(' ')[1].strip()
                self.__info = (_stock_info[:4],
                               _stock_info[4:].decode('utf-8'))
                self.__raw_rows_name = tolist[1]
                return tuple(tolist[2:])
            return tuple([])
        else:
            if len(tolist) > 6:
                self.__raw_rows_name = tolist[4]
                self.__info = (self.__get_no, OTCNo().all_stock[self.__get_no])
                if len(tolist[5:]) > 1:
                    return tuple(tolist[5:-1])
            return tuple([])
701898
def parse_checksum_file(self, file):
        
        checksums = dict()
        file_path = '/'.join((self.rawdir, file))
        with open(file_path, 'rt') as tsvfile:
            reader = csv.reader(tsvfile, delimiter=' ')
            for row in reader:
                (checksum, whitespace, file_name) = row
                checksums[checksum] = file_name

        return checksums
427725
def parse_file(file):
    
    lines = []
    for line in file:
        line = line.rstrip('\n')
        if line == '%%':
            # This is a separator between items. Parse the data we've
            # collected and yield the result.
            yield from parse_item(lines)
            lines.clear()
        elif line.startswith('  '):
            # This is a continuation line. Concatenate it to the previous
            # line, including one of the spaces.
            lines[-1] += line[1:]
        else:
            lines.append(line)
    yield from parse_item(lines)
1184759
def team_players(self, team):
        """"""
        players = sorted(team, key=lambda d: d['shirtNumber'])
        click.secho("%-4s %-25s    %-20s    %-20s    %-15s" %
                    ("N.",  "NAME", "POSITION", "NATIONALITY", "BIRTHDAY"),
                    bold=True,
                    fg=self.colors.MISC)
        fmt = (u"{shirtNumber:<4} {name:<28} {position:<23} {nationality:<23}"
               u" {dateOfBirth:<18}")
        for player in players:
            click.secho(fmt.format(**player), bold=True)
574551
def p5list(num):
    """"""

    from .website.pocketfives import get_ranked_players

    format_str = '{:>4.4}   {!s:<15.13}{!s:<18.15}{!s:<9.6}{!s:<10.7}'\
                 '{!s:<14.11}{!s:<12.9}{!s:<12.9}{!s:<12.9}{!s:<4.4}'

    click.echo(format_str.format(
        'Rank' , 'Player name', 'Country', 'Triple', 'Monthly', 'Biggest cash',
        'PLB score', 'Biggest s', 'Average s', 'Prev'
    ))
    # just generate the appropriate number of underlines and cut them with format_str
    underlines = ['-' * 20] * 10
    click.echo(format_str.format(*underlines))

    for ind, player in enumerate(get_ranked_players()):
        click.echo(format_str.format(str(ind + 1) + '.', *player))
        if ind == num - 1:
            break
1038189
def _log_players(self, players):
        
        self._logln('players: {0}'.format(len(players)))
        for p in self._players:
            self._logln('name: {0}, color: {1}, seat: {2}'.format(p.name, p.color, p.seat))
1223095
def analayse_tabular_file(filename)
      lines = CSV.parse(File.read(filename), col_sep: "\t", skip_lines: /^#/,
                                             headers: @column_names)
      lines.map(&:to_hash)
    end