<commit_before>package com.github.pwittchen;

import java.util.concurrent.Flow;
import java.util.function.Predicate;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Main {
  public static void main(String[] args) {

    Flow.Publisher<Integer> publisher = subscriber -> {
      IntStream.range(1, 11).forEach(subscriber::onNext);
      subscriber.onComplete();
    };

    publisher.subscribe(new Flow.Subscriber<>() {
      @Override public void onSubscribe(Flow.Subscription subscription) {
        System.out.println("onSubscribe");
      }

      @Override public void onNext(Integer item) {
        System.out.println("onNext: ".concat(item.toString()));
      }

      @Override public void onError(Throwable throwable) {
        System.out.println("onError: ".concat(throwable.getMessage()));
      }

      @Override public void onComplete() {
        System.out.println("onComplete");
      }
    });

    new Pipe()
        .of(Stream.of(1, 2, 3, 4, 5, 6))
        .filter(o -> (Integer) o % 2 == 0)
        .subscribe((Receiver) System.out::println);
  }
}

class Pipe implements Flow.Publisher {
  private Stream stream;

  public Pipe of(Stream stream) {
    this.stream = stream;
    return this;
  }

  public Pipe filter(Predicate predicate) {
    stream = stream.filter(predicate);
    return this;
  }

  @Override public void subscribe(Flow.Subscriber subscriber) {
    stream.forEach(o -> System.out.println(o.toString()));
  }
}

interface Receiver extends Flow.Subscriber {
  default void onSubscribe(Flow.Subscription subscription) {
  }

  default void onError(Throwable throwable) {
  }

  default void onComplete() {
  }
}<commit_msg>adding printing stacktrace<commit_after>package com.github.pwittchen;

import java.util.concurrent.Flow;
import java.util.function.Predicate;
import java.util.stream.IntStream;
import java.util.stream.Stream;

public class Main {
  public static void main(String[] args) {

    Flow.Publisher<Integer> publisher = subscriber -> {
      IntStream.range(1, 11).forEach(subscriber::onNext);
      subscriber.onComplete();
    };

    publisher.subscribe(new Flow.Subscriber<>() {
      @Override public void onSubscribe(Flow.Subscription subscription) {
        System.out.println("onSubscribe");
      }

      @Override public void onNext(Integer item) {
        System.out.println("onNext: ".concat(item.toString()));
      }

      @Override public void onError(Throwable throwable) {
        System.out.println("onError: ".concat(throwable.getMessage()));
      }

      @Override public void onComplete() {
        System.out.println("onComplete");
      }
    });

    new Pipe()
        .of(Stream.of(1, 2, 3, 4, 5, 6))
        .filter(o -> (Integer) o % 2 == 0)
        .subscribe((Receiver) System.out::println);
  }
}

class Pipe implements Flow.Publisher {
  private Stream stream;

  public Pipe of(Stream stream) {
    this.stream = stream;
    return this;
  }

  public Pipe filter(Predicate predicate) {
    stream = stream.filter(predicate);
    return this;
  }

  @Override public void subscribe(Flow.Subscriber subscriber) {
    stream.forEach(o -> System.out.println(o.toString()));
  }
}

interface Receiver extends Flow.Subscriber {
  default void onSubscribe(Flow.Subscription subscription) {
  }

  default void onError(Throwable throwable) {
    throwable.printStackTrace();
  }

  default void onComplete() {
  }
}
{'fraction_non_alphanumeric': 0.12703962703962704, 'fraction_numerical': 0.00641025641025641, 'mean_word_length': 3.222632226322263, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '1774818', 'n_tokens_mistral': 1055, 'n_tokens_neox': 999, 'n_words': 225}