<commit_before>module RMXFirebase

  def self.allNextOrCompleted(signals)
    groups = signals.each_slice(100).to_a.map { |x| x.size > 0 ? RACSignal.combineLatest(x).take(1).rmx_expandTuple : RACSignal.return([]) }
    all = groups.size > 0 ? RACSignal.combineLatest(groups).take(1).rmx_expandTuple : RACSignal.return([])
    all.map(->(x) { x.flatten })
  end

  def self.allNextOrCompletedSequential(signals, jitter:jitter)
    groups = signals.each_slice(100).to_a.map { |x| x.size > 0 ? RACSignal.concat(x).collect.rmx_expandTuple.delay(jitter) : RACSignal.return([]) }
    all = groups.size > 0 ? RACSignal.concat(groups).collect.rmx_expandTuple : RACSignal.return([])
    all.map(->(x) { x.flatten })
  end

  def self.batchSignal(*models)
    allNextOrCompleted(models.flatten.compact.map(&:strongOnceSignal))
  end

  def self.batchMainSignal(*models)
    batchSignal(*models).deliverOn(RACScheduler.mainThreadScheduler)
  end

end<commit_msg>switch back to sequential for now<commit_after>module RMXFirebase

  def self.allNextOrCompleted(signals)
    groups = signals.each_slice(100).to_a.map { |x| x.size > 0 ? RACSignal.combineLatest(x).take(1).rmx_expandTuple : RACSignal.return([]) }
    all = groups.size > 0 ? RACSignal.combineLatest(groups).take(1).rmx_expandTuple : RACSignal.return([])
    all.map(->(x) { x.flatten })
  end

  def self.allNextOrCompletedSequential(signals, jitter:jitter)
    groups = signals.each_slice(100).to_a.map { |x| x.size > 0 ? RACSignal.concat(x).collect.rmx_expandTuple.delay(jitter) : RACSignal.return([]) }
    all = groups.size > 0 ? RACSignal.concat(groups).collect.rmx_expandTuple : RACSignal.return([])
    all.map(->(x) { x.flatten })
  end

  def self.allNextOrCompletedSequential(signals)
    groups = signals.each_slice(100).to_a.map { |x| x.size > 0 ? RACSignal.concat(x).collect.rmx_expandTuple : RACSignal.return([]) }
    all = groups.size > 0 ? RACSignal.concat(groups).collect.rmx_expandTuple : RACSignal.return([])
    all.map(->(x) { x.flatten })
  end

  def self.batchSignal(*models)
    allNextOrCompletedSequential(models.flatten.compact.map(&:strongOnceSignal))
  end

  def self.batchMainSignal(*models)
    batchSignal(*models).deliverOn(RACScheduler.mainThreadScheduler)
  end

end
{'fraction_non_alphanumeric': 0.14722838137472283, 'fraction_numerical': 0.012860310421286032, 'mean_word_length': 4.682619647355164, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5363455', 'n_tokens_mistral': 840, 'n_tokens_neox': 807, 'n_words': 113}