Returns a set of names from file called filename. If filename is None, returns an empty set
432549
def _get_contigs_to_keep(self, filename):
        ''''''
        if filename is None:
            return set()

        with open(filename) as f:
            return {line.rstrip() for line in f}
784614
def from_filename(cls, filename):
    """"""
    result = cls._FROM_FILENAME_CACHE.get(filename)
    if result is None:
      result = cls(cls._normalize(filename))
      cls._FROM_FILENAME_CACHE.store(filename, result)
    return result
1108395
def getFilesForName(name):
    
    if not os.path.exists(name):
        # check for glob chars
        if containsAny(name, "*?[]"):
            files = glob.glob(name)
            list = []
            for file in files:
                list.extend(getFilesForName(file))
            return list

        # try to find module or package
        name = _get_modpkg_path(name)
        if not name:
            return []

    if os.path.isdir(name):
        # find all python files in directory
        list = []
        os.path.walk(name, _visit_pyfiles, list)
        return list
    elif os.path.exists(name):
        # a single file
        return [name]

    return []
286893
def get_part_filenames(num_parts=None, start_num=0):
    """"""
    if num_parts is None:
        num_parts = get_num_part_files()
    return ['PART{0}.html'.format(i) for i in range(start_num+1, num_parts+1)]
1055386
def get_file_named(self, fldr, xtn):
        
        res = []       # list of Sample objects
        for root, _, files in os.walk(fldr):
            for basename in files:
                if fnmatch.fnmatch(basename, xtn):
                    filename = os.path.join(root, basename)
                    res.append(filename)

        if len(res) > 0:   
            return res[0]
        else:
            return None
999827
def _getFilename(self, fileNumber):
        
        cur = self._connection.cursor()
        cur.execute('SELECT name FROM files WHERE id = ?', (fileNumber,))
        row = cur.fetchone()
        if row is None:
            return None
        else:
            return row[0]
710864
def get_filename(disposition):
    
    if disposition:
        params = [param.strip() for param in disposition.split(';')[1:]]
        for param in params:
            if '=' in param:
                name, value = param.split('=', 1)
                if name == 'filename':
                    return value.strip('"')
870486
def get_filenames_diff(self, r):
        """"""
        cmd = self.filenames_diff_cmd(r)

        diff_files = shell_out_ignore_exitcode(cmd, cwd=self.root)
        diff_files = self.parse_diff_filenames(diff_files)

        return set(f for f in diff_files if f.endswith('.py'))
1258097
def get_file_contents(filename):
    
    data = None
    try:
        with open(filename) as pf:
            data = pf.read()
    except IOError:
        # File not found, return None
        pass
    return data
347814
def names(self):
        
        found_names = []
        with open(self.filename) as f:
            content = f.readlines()
        for line in content:
            line = line.strip()
            if " " in line:
                attribute, value = line.split(" ", 1)
                attribute = attribute.strip()
                value = value.strip()
                if attribute.lower() in ['host']:
                    found_names.append(value)
        return found_names
792335
def read_file(fname):
    
    res = []
    try:
        with open(fname, 'r') as f:
            for line in f:
                line = line.rstrip('\n').rstrip('\r')
                if line and (line[0] != '#'):
                    regexline = ".*" + re.sub("\*", ".*", line) + ".*"
                    res.append(regexline.lower())
    except IOError:
        pass
    return res
1124837
function getFilenameWithoutExtension(filename) {
        var index = filename.lastIndexOf(".");
        return index === -1 ? filename : filename.slice(0, index);
    }
812734
def decode_filename(filename):
    """"""
    if isinstance(filename, unicode):
        return filename

    return filename.decode(sys.getfilesystemencoding())
45310
function getFileByName(filename){
    if(!isLoaded[filename]){
        isLoaded[filename] = true;
        let CIniUserMgr	= CreateFile(filename);
        if (CIniUserMgr.IsHave()) {
            iniList[filename] = CIniUserMgr;
        }
    }
    return iniList[filename];
}
158944
def split_filename(name):
    
    parts = hashed_filename_re.match(name).groupdict()
    return (parts['name'] or '', parts['hash'] or '', parts['ext'] or '')
1023780
def read(*filenames, **kwargs):
    
    encoding = kwargs.get('encoding', 'utf-8')
    sep = kwargs.get('sep', '\n')
    buf = []
    for fl in filenames:
        with codecs.open(os.path.join(HERE, fl), 'rb', encoding) as f:
            buf.append(f.read())
    return sep.join(buf)
997750
def get_os_file_names(files):
        

        fnames = []
        for f in files:
            if utils.is_str(f):
                fnames.append(f)
            elif isinstance(f, file_configuration_t):
                if f.content_type in (
                        file_configuration_t.CONTENT_TYPE.STANDARD_SOURCE_FILE,
                        file_configuration_t.CONTENT_TYPE.CACHED_SOURCE_FILE):

                    fnames.append(f.data)
            else:
                pass
        return fnames