Set the stream fromat of sub stream????
340078
def set_sub_stream_format(self, format, callback=None):
        '''
        
        '''
        params = {'format': format}
        return self.execute_command('setSubStreamFormat',
                                        params, callback=callback)
545862
def stream_subsegments(self):
        
        segment = self.current_segment()

        if self.streaming.is_eligible(segment):
            self.streaming.stream(segment, self._stream_subsegment_out)
858895
def set_stream_id(self, stream_id):
        """"""
        stream_id = validate_type(stream_id, type(None), *six.string_types)
        if stream_id is not None:
            stream_id = stream_id.lstrip('/')
        self._stream_id = stream_id
1313381
protected void setStream(
    int priority,
    Reliability reliability,
    Stream stream) throws SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "setStream",
        new Object[] { new Integer(priority), reliability, stream });
        
    ReliabilitySubset subset = getSubset(reliability);    
    subset.setStream(priority, stream);
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "setStream");
  }
633235
def subscribe(self, stream_type, **parameters):
        """"""
        parameters["stream_type"] = stream_type

        if (stream_type == "result") and ("buffering" not in parameters):
            parameters["buffering"] = True

        self.socketIO.emit(self.EVENT_NAME_SUBSCRIBE, parameters)
922018
function Stream( options ) {
	var args = arguments,
		opts = {},
		err;
	if ( args.length ) {
		opts = options;
	}
	if ( !( this instanceof Stream ) ) {
		return new Stream( opts );
	}
	err = validate( opts );
	if ( err ) {
		throw err;
	}
	Transform.call( this, opts );
	this._readableState.objectMode = true;
	this._data = '';

	return this;
}
653155
def realtime_stream(self, channel=1, typeno=0, path_file=None):
        
        ret = self.command(
            'realmonitor.cgi?action=getStream&channel={0}&subtype={1}'.format(
                channel, typeno)
        )

        if path_file:
            with open(path_file, 'wb') as out_file:
                shutil.copyfileobj(ret.raw, out_file)

        return ret.raw
739174
function subscribe (obs, path, index, length, type, val, id, fire, origin, event, nocontext) {
  if (index === length) {
    // TODO added this to subscribe to key => this is probably not the best way to catch this
    if (obs.on) {
      obs.on('remove', function () {
        // null
        subscribe(origin, path, 0, length, type, val, id, false, origin, event)
      }, id, true, event, nocontext)
      obs.on(type, val, id, true, event, nocontext)
    }
    if (fire) {
      // **TODO** SUPER DIRTY
      // need to have some godamn arguments
      if (event === void 0) {
        var trigger = true
        event = new Event('data') // wrong
      }

      if (typeof val === 'function') {
        val.call(obs, obs.__input, event)
      } else {
        // weird gaurd
        if (val && val[0]) {
          val[0].call(obs, type === 'data' ? obs.__input : void 0, event, val[1])
        }
      }

      if (trigger) {
        event.trigger()
      }
    }
    return obs
  } else {
    let key = path[index]
    let property = obs[key]
    let result

    if (property && property.__input !== null) {
      result = subscribe(property, path, index + 1, length, type, val, id, fire, origin, event, nocontext)
    } else {
      let listenerType = key === 'parent' ? key : 'property'
      let listener = function (data, event) {
        let property = obs[key]
        if (property) {
          obs.off(listenerType, id, void 0, true)
          subscribe(property, path, index + 1, length, type, val, id, true, origin, event, nocontext)
        }
      }
      obs.on(listenerType, listener, id, true, event, nocontext)
    }

    // if sub is not fulfilled look in the reference
    if (!result) {
      let reference = ref(obs)
      if (reference) {
        subscribe(reference, path, index, length, type, val, id, fire, origin, event, nocontext)
      }
    }
  }
}
920682
def mutate_stream (instream, outstream):
    """"""

    chunk = None
    key = None
    data = None
    misclines = []

    for fullline in instream:
        line = fullline.split ('#', 1)[0]

        m = sectionre.match (line)
        if m is not None:
            # New chunk
            if chunk is not None:
                if key is not None:
                    chunk.data.set_one (key, data.strip ().decode ('utf8'))
                    key = data = None
                yield chunk
                chunk.emit (outstream)

            chunk = FileChunk ()
            for miscline in misclines:
                chunk._addLine (miscline, None)
            misclines = []
            chunk.data.section = m.group (1)
            chunk._addLine (fullline, None)
            continue

        if len (line.strip ()) == 0:
            if key is not None:
                chunk.data.set_one (key, data.strip ().decode ('utf8'))
                key = data = None
            if chunk is not None:
                chunk._addLine (fullline, None)
            else:
                misclines.append (fullline)
            continue

        m = escre.match (fullline)
        if m is not None:
            if chunk is None:
                raise InifileError ('key seen without section!')
            if key is not None:
                chunk.data.set_one (key, data.strip ().decode ('utf8'))
            key = m.group (1)
            data = m.group (2).replace (r'\"', '"').replace (r'\n', '\n').replace (r'\\', '\\')
            chunk.data.set_one (key, data.decode ('utf8'))
            chunk._addLine (fullline, key)
            key = data = None
            continue

        m = keyre.match (line)
        if m is not None:
            if chunk is None:
                raise InifileError ('key seen without section!')
            if key is not None:
                chunk.data.set_one (key, data.strip ().decode ('utf8'))
            key = m.group (1)
            data = m.group (2)
            if not data[-1].isspace ():
                data += ' '
            chunk._addLine (fullline, key)
            continue

        if line[0].isspace () and key is not None:
            data += line.strip () + ' '
            chunk._addLine (fullline, key)
            continue

        raise InifileError ('unparsable line: ' + line[:-1])

    if chunk is not None:
        if key is not None:
            chunk.data.set_one (key, data.strip ().decode ('utf8'))
        yield chunk
        chunk.emit (outstream)
957128
private void setupIngestStreamWithRetries(long txid) throws IOException {
    for (int i = 0; i < inputStreamRetries; i++) {
      try {
        setupCurrentEditStream(txid);
        return;
      } catch (IOException e) {
        if (i == inputStreamRetries - 1) {
          throw new IOException("Cannot obtain stream for txid: " + txid, e);
        }
        LOG.info("Error :", e);
      }
      sleep(1000);
      LOG.info("Retrying to get edit input stream for txid: " + txid
          + ", tried: " + (i + 1) + " times");
    }
  }
1123935
def start_stream(self, stream_type, **stream_parameters):
        """"""
        if stream_type:
            self.subscribe(stream_type, **stream_parameters)
        else:
            self.handle_error("You need to set a stream type")
765877
function Stream (options) {

  //check options
  if (!options) {

    throw new Error('Initialization error: missing transport options')
  }

  this._initDefaults() //Initialize default params
  this._updateParams(options)
  this._initTransport(options.transport)

  var self = this

  self.on('error', nop)

  this.subscriptions = []

  this.getSubscriptions = function () {

    return this.subscriptions
  }

  this.addSubscription = function (args, callback) {

    var c = new Subscription(args, callback, this)
    this.subscriptions[c.eid] = c
    return c
  }

  this.getSubscription = function (channel, resource) {

    if (this.subscriptions[channel + this.seperator + resource]) {
      return this.subscriptions[channel + this.seperator + resource]
    }
    return null
  }

  this.getAnySubscription = function (channel, resource) {

    if (this.subscriptions[channel + this.seperator + resource]) {
      return this.subscriptions[channel + this.seperator + resource]
    } else if (this.subscriptions[channel + this.seperator + this.wildcard]) {
      return this.subscriptions[channel + this.seperator + this.wildcard]
    } else {
      return null
    }
  }

  this.removeSubscription = function (channel, resource) {

    resource = resource || this.wildcard
    if (this.subscriptions[channel + this.seperator + resource]) {
      var retval = this.subscriptions[channel + this.seperator + resource]
      delete this.subscriptions[channel + this.seperator + resource]
      return retval
    }

    return null
  }

  this.getSubscriptionWithPermission = function (channel, resource, read, write) {

    var Subscription = this.subscriptions[channel + this.seperator + resource]
    var match = false

    if (Subscription) {

      match = true

      if (read) {
        match = Subscription.hasReadPermission()
      }

      if (write) {
        match = Subscription.hasWritePermission()
      }

      if (match) {
        return Subscription
      }
    } else {

      Subscription = this.subscriptions[channel + this.seperator + this.wildcard]

      if (Subscription) {

        match = true

        if (read) {
          match = Subscription.hasReadPermission()
        }

        if (write) {
          match = Subscription.hasWritePermission()
        }

        if (match) {
          return Subscription
        }
      }
    }

    return null
  }

  this.connection = new this.ConnectionFactory(this)
  this.connect()
}
165424
def write_stream(self, stream, left_chunk, right_chunk, volume):
        '''
        
        '''
        if len(left_chunk) != len(right_chunk):
            raise ValueError()

        for i in range(len(left_chunk)):
            chunk = (left_chunk[i] + right_chunk[i]) * volume
            data = struct.pack("2f", chunk, chunk)
            stream.write(data)
568436
def copy(self):
    
    if self._iters:
      a, b = it.tee(self._iters[0])
      self._iters[0] = a
      return Stream(b)
    iter(self)
92418
def new_encoded_stream(args, stream):
    ''''''
    if args.ascii_print:
        return wpull.util.ASCIIStreamWriter(stream)
    else:
        return stream
201495
def clear_to_reset(self, config_vars):
        """"""

        super(BasicStreamingSubsystem, self).clear_to_reset(config_vars)
        self._in_progress_streamers = set()
249798
function makeStream(conn) {
    return function stream(sql, options = { highWaterMark: 5 }) {
        return conn.query(sql).stream(options);
    };
}