Load resource contents as stream.
513905
public function getResourceStream(DatabaseResource $resource): StreamInterface
    {
        switch ($this->conn->getDriverName()) {
            case DB::DRIVER_MYSQL:
            case DB::DRIVER_SQLITE:
                $stmt = $this->conn->prepare("SELECT `data` FROM `#__webdav_file_data` WHERE `resource_id` = :id ORDER BY `resource_id`, `chunk`");
                $stmt->bindValue('id', $resource->getIdentifier());
                $stmt->transform('data', new StreamTransformer());
                
                return new DatabaseOutputStream($stmt);
        }
        
        $stmt = $this->conn->prepare("SELECT `data` FROM `#__webdav_file_data` WHERE `resource_id` = :id");
        $stmt->bindValue('id', $resource->getIdentifier());
        $stmt->transform('data', new StreamTransformer());
        $stmt->execute();
        
        return $stmt->fetchNextColumn('data');
    }
1099361
def load(stream=None):
    
    if stream:
        loads(stream.read())
    else:
        data = pkgutil.get_data(insights.__name__, _filename)
        return loads(data) if data else None
1119457
def yml_load(stream, container, **options):
    
    ret = yml_fnc("load", stream, **options)
    if ret is None:
        return container()

    return ret
693538
def reader(stream):
    """"""
    for line in stream:
        item = Item()
        item.json = line
        yield item
1048097
def load(self):
        """"""
        try:
            self._read()
            self._parse()
        except Exception as exc:
            self.failed = True

            params = {'path': self._path, 'exception': exc}
            if self.fail_silently:
                LOG.warning("Error processing message json file '%(path)s': "
                            "%(exception)s", params)
            else:
                raise exceptions.MessageFailure(
                    _("Error processing message json file '%(path)s': "
                      "%(exception)s") % params)
1332165
def load(self):
        
        stream = self.fs.load()
        stream = self.codec.decompress(stream)
        return stream
149824
def do_load(self, filename):
        """"""
        try:
            self.__session.load(filename)
        except IOError as e:
            self.logger.error(e.strerror)
1217531
private void loadDataFromInternet() throws IOException {
		URL url = new URL(DATA_RETRIVE_URL);
		InputStream is = url.openStream();
		try {
			PHPFileParser fp = new PHPFileParser(is);
			createInternalDataStructre(fp.getSections());
		} finally {
			is.close();
		}
	}
771981
def items(stream, **kwargs):
    
    for s in yield_json(stream):
        yield json.loads(s, **kwargs)
1016495
def _get_streams(self, uri_suffix=None):
        """"""
        # TODO: handle paging, perhaps change this to be a generator
        if uri_suffix is not None and not uri_suffix.startswith('/'):
            uri_suffix = '/' + uri_suffix
        elif uri_suffix is None:
            uri_suffix = ""
        streams = {}
        response = self._conn.get_json("/ws/DataStream{}".format(uri_suffix))
        for stream_data in response["items"]:
            stream_id = stream_data["streamId"]
            stream = DataStream(self._conn, stream_id, stream_data)
            streams[stream_id] = stream
        return streams
1170048
def load(self, name, code):
        """"""

        source = "\n".join(code)
        self._objects[name] = source
1192096
def _load_contents(self, polib, resource):
        
        import struct
        try:
            return polib.mofile(resource)
        except (ValueError, AttributeError, struct.error) as e:
            self.rethrow(
                "Invalid resource {0}".format(resource),
                InvalidResourceException)
1103428
public void load() throws IOException {
        if (resource.toExternalForm().endsWith(".xml")) {
            // XML Format
            bundle = new XMLResourceBundle(resource.openStream());
        } else {
            // Properties file (loaded using UTF-8)
            bundle = new UTF8PropertiesResourceBundle(resource.openStream());
        }

        if (bundle.keySet().isEmpty()) {
            throw new IOException(resource.toExternalForm() + " is not a valid resource - no keys");
        }
    }
1080234
def loader():
    """"""
    url = request.args.get('url')  # read image URL as a request URL param
    response = requests.get(url)  # make request to static image file
    return response.content
223166
def fetch_to_file(self, filename):
        """"""
        self.filename = filename
        stream = self.client.get_iter_content(self.uri)
        content_type = self.client.response_headers['content-type']

        if content_type in _content_type_map:
            self.fileext = _content_type_map[content_type]
            self.filename = "%s.%s" % (self.filename, self.fileext)

        with open(self.filename, 'wb') as file_handle:
            for chunk in stream:
                file_handle.write(chunk)
875479
def load_all(stream):
    
    loader = YAMLDictLoader(stream)
    try:
        while loader.check_data():
            yield loader.get_data()
    finally:
        loader.dispose()
605493
def load_metadata(stream):
    """"""
    try:
        metadata = json.load(
            stream, encoding='utf8', object_pairs_hook=OrderedDict)
    except json.JSONDecodeError as e:
        err = RuntimeError('Error parsing {}: {}'.format(stream.name, e))
        raise_from(err, e)
    else:
        # convert changelog keys back to ints for sorting
        for group in metadata:
            if group == '$version':
                continue
            apis = metadata[group]['apis']
            for api in apis.values():
                int_changelog = OrderedDict()
                for version, log in api.get('changelog', {}).items():
                    int_changelog[int(version)] = log
                api['changelog'] = int_changelog
    finally:
        stream.close()

    return metadata