Load all strings of a given file
439667
def load_strings(strings_filename)
      strings = {}
      comments = {}
      # genstrings uses utf16, so that's what we expect. utf8 should not be impact
      file = File.open(strings_filename, "r:utf-16:utf-8")
      begin
        contents = file.read
        if RUBY_VERSION == "1.9.2"
          # fixes conversion, see http://po-ru.com/diary/fixing-invalid-utf-8-in-ruby-revisited/
          require 'iconv'
          ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')
          contents = ic.iconv(contents + ' ')[0..-2]
        end
      rescue Encoding::InvalidByteSequenceError => e
        # silent error
        # faults back to utf8
        contents = File.open(strings_filename, "r:utf-8")
      end
      previous_comment = nil
      contents.each_line do |line|
        key, value = self.parse_dotstrings_line(line)
        if key
          strings.merge!({key => value}) 
          comments[key] = previous_comment if previous_comment
        else
          previous_comment = self.parse_comment_line(line)
        end
      end

      [strings, comments]
    end
1366250
def _readall(self, file, count):
        
        data = b""
        while len(data) < count:
            d = file.read(count - len(data))
            if not d:
                raise GeneralProxyError("Connection closed unexpectedly")
            data += d
        return data
1303335
def load(self, filename, offset):
        """"""
        try:
            self.offset = offset
            # self.fd = open(filename, 'rb')
            # self.fd.close()
        except IOError as e:
            print(e)
1292728
def load(glob)
      b = binding
      Dir[glob].each do |f|
        eval(File.read(f), b, f)
      end
    end
202792
def loadstring_and_call(s, bndng, filename, lineno)

      bottom = stack_top
      chunk = filename ? "#{filename}:#{lineno}" : 'line'

      err = Lib.luaL_loadbuffer(@pointer, s, s.bytesize, chunk)
      fail_if_error('eval:compile', err, bndng, filename, lineno)

      pcall(bottom, 0, bndng, filename, lineno) # arg_count is set to 0
    end
535384
def _load_from_string(data):
    ''''''
    global _CACHE
    if PYTHON_3:
        data = json.loads(data.decode("utf-8"))
    else:
        data = json.loads(data)
    _CACHE = _recursively_convert_unicode_to_str(data)['data']
715601
def load_from_file(filename):
    '''
    
    '''
    t = None
    with open(filename, 'rU') as infile:
        tdata = infile.read()
        t = Topology.unserialize(tdata)
    return t
909726
def load_from_file(self, fname):
        
        with open(fname, 'r') as f:
            for line in f:
                k,v = line.split(' = ')
                self._parse_char_line_to_self(k,v)
344518
def _load_data(path):
    
    path = os.path.abspath(path)
    if not os.path.isdir(path):
        raise InitializationError('Directory not found: {0}'.format(path))
    wordlists = {}
    for file_name in os.listdir(path):
        if os.path.splitext(file_name)[1] != '.txt':
            continue
        file_path = os.path.join(path, file_name)
        name = os.path.splitext(os.path.split(file_path)[1])[0]
        try:
            with codecs.open(file_path, encoding='utf-8') as file:
                wordlists[name] = _load_wordlist(name, file)
        except OSError as ex:
            raise InitializationError('Failed to read {}: {}'.format(file_path, ex))
    config = _load_config(os.path.join(path, 'config.json'))
    return (config, wordlists)
564879
def load_from_file(cls, filename_prefix):
    """"""
    filename = cls._filename(filename_prefix)
    lines, _ = cls._read_lines_from_file(filename)
    # Strip wrapping single quotes
    vocab_list = [line[1:-1] for line in lines]
    return cls(vocab_list=vocab_list)
941252
def load_file(self, filename):
        """"""

        self.counter.clear()
        # python2 issues
        try:
            etree = ET.parse(filename)
        except ET.ParseError:
            parser = ET.XMLParser(encoding='UTF-8')
            etree = ET.parse(filename, parser)
        eroot = etree.getroot()

        self.remove_all()
        self.previewer.remove_all()
        self.widget_editor.hide_all()

        self.previewer.resource_paths.append(os.path.dirname(filename))
        for element in eroot:
            self.populate_tree('', eroot, element,from_file=True)
        children = self.treeview.get_children('')
        for child in children:
            self.draw_widget(child)
        self.previewer.show_selected(None, None)
100972
def load(self, fname):
        '''
        
        '''
        # Magic files must be ASCII, else encoding issues can arise.
        fp = open(fname, "r")
        lines = fp.readlines()
        self.parse(lines)
        fp.close()
735028
private static List<String> readAllLines(File f) throws IOException {
        BufferedReader r = new BufferedReader(new FileReader(f));
        try {
            List<String> result = new ArrayList<String>();
            String line;
            while ((line = r.readLine()) != null) {
                result.add(line);
            }
            return result;
        }  finally {
            r.close();
        }
    }
439396
public static Map<String, File> loadStringToFileMap(final File f) throws IOException {
    return loadStringToFileMap(Files.asCharSource(f, Charsets.UTF_8));
  }
834145
def read_string(self, string, source='<string>'):
        """"""
        sfile = io.StringIO(string)
        self.read_file(sfile, source)
848906
def load_files(files):
    """"""

    for py_file in files:
        LOG.debug("exec %s", py_file)
        execfile(py_file, globals(), locals())
450481
function load( filename, fmt ) {
	var config,
		parse,
		file,
		ext;

	if ( arguments.length > 1 ) {
		ext = fmt;
		if ( !isString( ext ) ) {
			throw new TypeError( 'invalid input argument. Extension argument must be a primitive string. Value: `' + ext + '`.' );
		}
		if ( ext[ 0 ] !== '.' ) {
			ext = '.' + ext;
		}
	} else {
		ext = extname( filename );
	}
	ext = ext.toLowerCase();
	if ( ext === '.js' ) {
		file = path.resolve( cwd(), filename );
		return require( file );
	}
	parse = getParser( ext );
	if ( parse === null ) {
		throw new Error( 'invalid input argument. Input argument has an unrecognized/unsupported file extension: `' + ext + '`. Supported extensions: [' + ( exts().join( ',' ) ) + '].' );
	}
	file = path.resolve( cwd(), filename );
	file = fs.readFileSync( file, {
		'encoding': 'utf8'
	});
	config = parse( file );
	if ( config instanceof Error ) {
		throw config;
	}
	return config;
}