code: def _new_stream(self, idx):
          '''Randomly select and create a stream.
  
          Parameters
          ----------
          idx : int, [0:n_streams - 1]
              The stream index to replace
          '''
          # instantiate
          if self.rate is not None:
              n_stream = 1 + self.rng.poisson(lam=self.rate)
          else:
              n_stream = None
  
          # If we're sampling without replacement, zero this one out
          # This effectively disables this stream as soon as it is chosen,
          # preventing it from being chosen again (unless it is revived)
          if not self.with_replacement:
              self.distribution_[idx] = 0.0
  
              # Correct the distribution
              if (self.distribution_ > 0).any():
                  self.distribution_[:] /= np.sum(self.distribution_)
  
          return (self.streamers[idx].iterate(max_iter=n_stream),
                  self.weights[idx]f _new_stream(self, idx):
          '''Randomly select and create a stream.
  
          Parameters
          ----------
          idx : int, [0:n_streams - 1]
              The stream index to replace
          '''
          # instantiate
          if self.rate is not None:
              n_stream = 1 + self.rng.poisson(lam=self.rate)
          else:
              n_stream = None
  
          # If we're sampling without replacement, zero this one out
          # This effectively disables this stream as soon as it is chosen,
          # preventing it from being chosen again (unless it is revived)
          if not self.with_replacement:
              self.distribution_[idx] = 0.0
  
              # Correct the distribution
              if (self.distribution_ > 0).any():
                  self.distribution_[:] /= np.sum(self.distribution_)
  
          return (self.streamers[idx].iterate(max_iter=n_stream),
                  self.weights[idx])
docs: Randomly select and create a stream.
  
          Parameters
          ----------
          idx : int, [0:n_streams - 1]
              The stream index to replace