Reads the kml file, parses it and updated the Google transit feed
    object with the extracted information.

    Args:
      filename - kml file name
      feed - an instance of Schedule class to be updated
169338
def Parse(self, filename, feed):
    
    dom = minidom.parse(filename)
    self.ParseDom(dom, feed)
1343078
def get_from_archive(self, feed_id):
        
        file_path = self.feed_repository + '/' + str(feed_id) + '.xml'
        if not os.path.isfile(file_path):
            raise FeedArchiveNotFound()
        with open(file_path, 'r') as rec_file:
            return rec_file.read()
811665
def load_file(self, file_name):
        
        locator = self._make_locator()

        path = locator.find_file(file_name, self.search_dirs)

        return self.read(path)
1223705
def load(self, filename):
        
        self.filename = filename
        with open(filename) as CFG:
            self.data = yaml.load(CFG.read())

        return self
244130
def load(self, file_name):
        

        new_rundata = self.loader(file_name)
        new_rundata = self.inspect(new_rundata)
        return new_rundata
405870
def _parse_metadata_filename(self, metadata):
        
        index = metadata['Content-Disposition'].index('=')+1
        metadata['filename'] = metadata['Content-Disposition'][index:].replace('"', '')
        return metadata
281315
def consume_file(self, filename):
        """"""
        with screed.open(filename) as sequences:
            for seq in sequences:
                self.consume(seq['sequence'])
911638
def parse_filename(filename):
    

    _patterns = patterns.get_expressions()
    result = {}

    for cmatcher in _patterns:
        match = cmatcher.match(filename)
        if match:
            namedgroups = match.groupdict().keys()

            result['pattern'] = cmatcher.pattern
            result['series_name'] = match.group('seriesname')
            result['season_number'] = _get_season_no(match, namedgroups)
            result['episode_numbers'] = _get_episodes(match, namedgroups)
            break
    else:
        result = None

    return result
769812
def from_file(self, filename):
        
        with gzip.open(filename, 'rb') as f:
            self.parse(f.read())
1022189
def _addDataFile(self, filename):
        
        if filename.endswith('.ttl'):
            self._rdfGraph.parse(filename, format='n3')
        else:
            self._rdfGraph.parse(filename, format='xml')
167730
def parse(feedparser, args):
    """"""
    entries = []
    args = irc3.utils.Config(args)
    max_date = datetime.datetime.now() - datetime.timedelta(days=2)

    for filename in args['filenames']:
        try:
            with open(filename + '.updated') as fd:
                updated = fd.read().strip()
        except (OSError, IOError):
            updated = '0'

        feed = feedparser.parse(filename)
        for e in feed.entries:
            if e.updated <= updated:
                # skip already sent entries
                continue
            try:
                updated_parsed = e.updated_parsed
            except AttributeError:
                continue
            if datetime.datetime(*updated_parsed[:7]) < max_date:
                # skip entries older than 2 days
                continue
            e['filename'] = filename
            e['feed'] = args
            entries.append((e.updated, e))
        if entries:
            entries = sorted(entries, key=itemgetter(0))
            with open(filename + '.updated', 'w') as fd:
                fd.write(str(entries[-1][0]))
    return entries
1003998
def load_data(self, filename):
        
        with zopen(filename, "rt") as f:
            self._data = json.load(f, cls=MontyDecoder)
556855
private String readFile(String fileName) {
        String text;
        try {
            try (Reader r = new FileReader(fileName)) {
                text = Kit.readReader(r);
            }
        } catch (IOException ex) {
            MessageDialogWrapper.showMessageDialog(this,
                                                   ex.getMessage(),
                                                   "Error reading "+fileName,
                                                   JOptionPane.ERROR_MESSAGE);
            text = null;
        }
        return text;
    }
356398
def push(self, filename, data):
        
        self._queue.put(Chunk(filename, data))
271258
def load_file(self, filename):
        
        self._say("Loading file: " + filename)

        fh    = codecs.open(filename, 'r', 'utf-8')
        lines = fh.readlines()
        fh.close()

        self._say("Parsing " + str(len(lines)) + " lines of code from " + filename)
        self._parse(filename, lines)
1101461
def read_file(self, filename):
        
        self.pack = {}
        with open(filename, "r") as f:
            for line in f:
                line = line.strip()
                if (len(line) == 0) or (line[0] == "#"):
                    continue
                try:
                    self._parse_modulus(line)
                except:
                    continue
45191
def load(name_or_file):
    
    f = name_or_file
    opened = False

    if isinstance(name_or_file, basestring):
        f = open(name_or_file, 'rb')
        opened = True
    elif not hasattr(f, 'read'):
        raise ValueError('Readable stream expected')

    name, values = decode(f.read())
    s = SOL(name)

    for n, v in values.iteritems():
        s[n] = v

    if opened is True:
        f.close()

    return s