Get or create the inbound stream with the specified ID.
336442
def _get_inbound_stream(self, stream_id):
        
        if stream_id not in self._inbound_streams:
            self._inbound_streams[stream_id] = InboundStream()
        return self._inbound_streams[stream_id]
1352901
def by_id(self, id):
        """"""
        path = partial(_path, self.adapter)
        path = path(id)
        return self._get(path)
571139
async def get_pushed_stream_ids(self, parent_stream_id: int) -> List[int]:
        
        if parent_stream_id not in self._streams:
            logger.error(
                f'Parent stream {parent_stream_id} unknown to this connection'
            )
            raise NoSuchStreamError(parent_stream_id)
        parent = self._get_stream(parent_stream_id)

        await parent.pushed_streams_available.wait()
        pushed_streams_ids = self._pushed_stream_ids[parent.id]

        stream_ids: List[int] = []
        if len(pushed_streams_ids) > 0:
            stream_ids.extend(pushed_streams_ids)
            pushed_streams_ids.clear()
            parent.pushed_streams_available.clear()

        return stream_ids
750611
public static channel get(nitro_service service, String id) throws Exception{
		channel obj = new channel();
		obj.set_id(id);
		channel response = (channel) obj.get_resource(service);
		return response;
	}
479724
def create_stream(self, stream_id, sandbox=None):
        
        if sandbox is not None:
            raise NotImplementedError

        logging.debug("Creating asset stream {}".format(stream_id))

        if stream_id in self.streams:
            raise StreamAlreadyExistsError("Stream with id '{}' already exists".format(stream_id))

        stream = AssetStream(channel=self, stream_id=stream_id, calculated_intervals=None,
                             last_accessed=utcnow(), last_updated=utcnow(), sandbox=sandbox)
        self.streams[stream_id] = stream
        return stream
1204219
def get_stream_url(self, session_id, stream_id=None):
        
        url = self.api_url + '/v2/project/' + self.api_key + '/session/' + session_id + '/stream'
        if stream_id:
            url = url + '/' + stream_id
        return url
692431
public int getChannelIdForStreamId(Number streamId) {
        int channelId = (int) (streamId.doubleValue() * 5) - 1;
        if (log.isTraceEnabled()) {
            log.trace("Channel id: {} requested for stream id: {}", channelId, streamId);
        }
        return channelId;
    }
163172
def get(cls, id_):
        """"""
        with db.session.no_autoflush:
            query = cls.dbmodel.query.filter_by(id=id_)
            try:
                model = query.one()
            except NoResultFound:
                raise WorkflowsMissingObject("No object for for id {0}".format(
                    id_
                ))
            return cls(model)
255143
private boolean registerStream(IClientStream stream) {
        if (streams.putIfAbsent(stream.getStreamId().doubleValue(), stream) == null) {
            usedStreams.incrementAndGet();
            return true;
        }
        log.error("Unable to register stream {}, stream with id {} was already added", stream, stream.getStreamId());
        return false;
    }
1026083
@Path("/{dsID}/content")
    @GET
    public Response getDatastream(@PathParam(RestParam.PID) String pid,
                                  @PathParam(RestParam.DSID) String dsID,
                                  @QueryParam(RestParam.AS_OF_DATE_TIME) String dateTime,
                                  @QueryParam(RestParam.DOWNLOAD) String download,
                                  @QueryParam(RestParam.FLASH) @DefaultValue("false") boolean flash) {
        Context context = getContext();
        try {
            Date asOfDateTime = DateUtility.parseDateOrNull(dateTime);
            MIMETypedStream stream =
                    m_access.getDatastreamDissemination(context,
                                                           pid,
                                                           dsID,
                                                           asOfDateTime);
            if (m_datastreamFilenameHelper != null) {
                m_datastreamFilenameHelper
                        .addContentDispositionHeader(context,
                                                     pid,
                                                     dsID,
                                                     download,
                                                     asOfDateTime,
                                                     stream);

            }

            return buildResponse(stream);
        } catch (Exception ex) {
            return handleException(ex, flash);
        }
    }
718540
def _new_stream(self, idx):
        '''
        '''
        # Choose the stream index from the candidate pool
        self.stream_idxs_[idx] = self.rng.choice(
            self.n_streams, p=self.distribution_)

        # Activate the Streamer, and get the weights
        self.streams_[idx], self.stream_weights_[idx] = self._activate_stream(
            self.stream_idxs_[idx])

        # Reset the sample count to zero
        self.stream_counts_[idx] = 0
323525
private static synchronized void createStream(Http2Connection conn, int streamId) throws Http2Exception {
        conn.local().createStream(streamId, false);
        if (LOG.isDebugEnabled()) {
            LOG.debug("Stream created streamId: {}", streamId);
        }
    }
1118363
def stream(self, handler, whenDone=None):
    
    self._createConfluence()
    headers = ["timestamp"] + self.getStreamIds()
    for row in self._confluence:
      handler(headers, row)
    
    if whenDone is not None:
      return whenDone()
1006146
async def _window_open(self, stream_id: int):
        
        stream = self._get_stream(stream_id)
        return await stream.window_open.wait()
1160266
public Observable<InputStream> downloadQueryLogsAsync(UUID appId) {
        return downloadQueryLogsWithServiceResponseAsync(appId).map(new Func1<ServiceResponse<InputStream>, InputStream>() {
            @Override
            public InputStream call(ServiceResponse<InputStream> response) {
                return response.body();
            }
        });
    }
16174
public Event load(Serializable id) {
		String sql = "select * from Event where id = ?";
		return getSimpleJdbcTemplate().queryForObject(sql, new EventMapper(), id);
	}
137452
def set_stream(self, stream_id):
        """"""
        self._group['stream_id'] = stream_id
        yield from self._server.group_stream(self.identifier, stream_id)
        _LOGGER.info('set stream to %s on %s', stream_id, self.friendly_name)