This returns the live stream only, without the parameter chunks
162603
function getLiveStream(options) {
    return raspivid(Object.assign({
        width: 960,
        height: 540,
        framerate: 20,
        profile: 'baseline',
        timeout: 0
    }, options))
    .pipe(new Splitter(NALseparator))
    .pipe(new stream.Transform({ transform: function (chunk, encoding, callback) {
        const chunkWithSeparator = Buffer.concat([NALseparator, chunk]);

        const chunkType = chunk[0] & 0b11111;

        // Capture the first SPS & PPS frames, so we can send stream parameters on connect.
        if (chunkType === 7 || chunkType === 8) {
            headerData.addParameterFrame(chunkWithSeparator);
        } else {
            // The live stream only includes the non-parameter chunks
            this.push(chunkWithSeparator);

            // Keep track of the latest IDR chunk, so we can start clients off with a near-current image
            if (chunkType === 5) {
                headerData.idrFrame = chunkWithSeparator;
            }
        }

        callback();
    }}));
}
344586
def stream(input, encoding=None, errors='strict'):
	
	
	input = (i for i in input if i)  # Omits `None` (empty wrappers) and empty chunks.
	
	if encoding:  # Automatically, and iteratively, encode the text if requested.
		input = iterencode(input, encoding, errors=errors)
	
	return input
635830
def get_stream(data=None):
        
        if len(__mstreams_available__) == 0:
            if data:
                mstream = MemoryStream(data)
                mstream.seek(0)
            else:
                mstream = MemoryStream()
            __mstreams__.append(mstream)
            return mstream

        mstream = __mstreams_available__.pop()

        if data is not None and len(data):
            mstream.clean_up()
            mstream.write(data)

        mstream.seek(0)

        return mstream
625325
def get_stream(self, stream):
        
        path = '/archive/{}/streams/{}'.format(self._instance, stream)
        response = self._client.get_proto(path=path)
        message = archive_pb2.StreamInfo()
        message.ParseFromString(response.content)
        return Stream(message)
85072
public StreamRecord<T> getStreamRecord() {
		StreamRecord<T> streamRecord = new StreamRecord<>(value);
		if (hasTimestamp) {
			streamRecord.setTimestamp(timestamp);
		}
		return streamRecord;
	}
1290332
def _stream(self):  # pragma: no cover
        """"""
        self.factory.protocol = LiveStream
        self.factory.datasift = {
            'on_open': self._on_open,
            'on_close': self._on_close,
            'on_message': self._on_message,
            'send_message': None
        }
        if self.config.ssl:
            from twisted.internet import ssl
            options = ssl.optionsForClientTLS(hostname=WEBSOCKET_HOST)
            connectWS(self.factory, options)
        else:
            connectWS(self.factory)
        reactor.run()
162269
def dump(self, stream=None):
        
        if stream is None:
            stream = BytesIO()

        if isinstance(stream, bytes):
            stream = BytesIO(stream)

        stream = self.codec.compress(stream)
        self.fs.dump(stream)

        return self
1299814
public Stream<T> stream() {
    if (thread == null) {
      synchronized (this) {
        if (thread == null) {
          thread = new Thread(() -> read(queue));
          thread.setDaemon(true);
          thread.start();
        }
      }
    }
    @Nullable final Iterator<T> iterator = new AsyncListIterator<>(queue, thread);
    return StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.DISTINCT), false).filter(x -> x != null);
  }
127167
public Stream<LocalDate> stream() {
        long count = end.toEpochDay() - start.toEpochDay() + (isUnboundedEnd() ? 1 : 0);
        Spliterator<LocalDate> spliterator = new Spliterators.AbstractSpliterator<LocalDate>(
                count,
                Spliterator.IMMUTABLE | Spliterator.NONNULL | Spliterator.DISTINCT | Spliterator.ORDERED |
                        Spliterator.SORTED | Spliterator.SIZED | Spliterator.SUBSIZED) {

            private LocalDate current = start;
            
            @Override
            public boolean tryAdvance(Consumer<? super LocalDate> action) {
                if (current != null) {
                    if (current.isBefore(end)) {
                        action.accept(current);
                        current = current.plusDays(1);
                        return true;
                    }
                    if (current.equals(LocalDate.MAX)) {
                        action.accept(LocalDate.MAX);
                        current = null;
                        return true;
                    }
                }
                return false;
            }
            
            @Override
            public Comparator<? super LocalDate> getComparator() {
                return null;
            }
        };
        return StreamSupport.stream(spliterator, false);
    }
719491
def _stream_data(self, chunk=None):
        

        # If we failed to transmit a chunk, we will be requeued with an argument
        self._stream_sm_running = True

        if chunk is None:
            chunk = self._next_streaming_chunk(20)

        if chunk is None or len(chunk) == 0:
            self._stream_sm_running = False
            return

        try:
            self._send_notification(StreamingChar.value_handle, chunk)
            self._defer(self._stream_data)
        except bable_interface.BaBLEException as err:
            if err.packet.status == 'Rejected':  # If we are streaming too fast, back off and try again
                time.sleep(0.05)
                self._defer(self._stream_data, [chunk])
            else:
                self._audit('ErrorStreamingReport')  # If there was an error, stop streaming but don't choke
                self._logger.exception("Error while streaming data")
817327
def <<(stream)
      case stream_type(stream)
      when :client then
        return unless stream.connected?
        jid = stream.user.jid.bare
        @clients[jid] ||= []
        @clients[jid] << stream
      when :server then @servers << stream
      when :component then @components << stream
      end
    end
891255
@SuppressWarnings("rawtypes")
    public Stream<Link> stream() {
        return links.values()
                .stream()
                .map(obj -> {
                    if (obj instanceof List) {
                        return (List) obj;
                    } else {
                        return singletonList(obj);
                    }
                })
                .flatMap(Collection::stream);
    }
1200427
def Trim(self):
        
        ms = StreamManager.GetStream()
        writer = BinaryWriter(ms)
        self.SerializeUnsigned(writer)
        writer.WriteByte(1)
        self.Script.Serialize(writer)

        writer.WriteHashes([tx.Hash.ToBytes() for tx in self.Transactions])
        retVal = ms.ToArray()
        StreamManager.ReleaseStream(ms)
        return retVal
847646
def stream_pty(self) -> 'StreamPty':
        '''
        
        '''
        params = {}
        if self.owner_access_key:
            params['owner_access_key'] = self.owner_access_key
        request = Request(self.session,
                          'GET', '/stream/kernel/{}/pty'.format(self.kernel_id),
                          params=params)
        return request.connect_websocket(response_cls=StreamPty)
593136
def stream_index(self, bucket, index, startkey, endkey=None,
                     return_terms=None, max_results=None, continuation=None,
                     timeout=None):
        
        raise NotImplementedError
245206
def stream_download(url, target_path, verbose=False):
    
    response = requests.get(url, stream=True)
    handle = open(target_path, "wb")
    if verbose:
        print("Beginning streaming download of %s" % url)
        start = datetime.now()
        try:
            content_length = int(response.headers['Content-Length'])
            content_MB = content_length/1048576.0
            print("Total file size: %.2f MB" % content_MB)
        except KeyError:
            pass      # allow Content-Length to be missing
    for chunk in response.iter_content(chunk_size=512):
        if chunk:     # filter out keep-alive new chunks
            handle.write(chunk)
    if verbose:
        print(
            "Download completed to %s in %s" %
            (target_path, datetime.now() - start))
1324840
function streamToString(callback) {
  var contents = '';

  return through(
    function (chunk, enc, next) {
      contents += chunk.toString('utf8');
      next();
    },
    function (next) { // flush function
      callback.bind(this)(contents, next);
    }
  );
}