<commit_before>import 'dart:async';
import 'dart:convert';

const int _LF = 10;
const int _CR = 13;

/// Provide Stream class for Twitter user Stream.
class TwitterStream extends Stream<Object> {
  Stream<String> _source;
  StreamSubscription<Object> _subscription;
  StreamController<Object> _controller;
  String _piecetweet = "";
  JsonDecoder _decoder = new JsonDecoder();

  TwitterStream(Stream<String> source) : _source = source {
    _controller = new StreamController<Object>(
        onListen: _onListen,
        onPause: _onPause,
        onResume: _onResume,
        onCancel: _onCancel);
  }

  StreamSubscription<Object> listen(void onData(Object tweet),
      {void onError(Error error), void onDone(), bool cancelOnError}) {
    return _controller.stream.listen(onData,
        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
  }

  void _onListen() {
    _subscription =
        _source.listen(_onData, onError: _controller.addError, onDone: _onDone);
  }

  void _onPause() {
    _subscription.pause();
  }

  void _onResume() {
    _subscription.resume();
  }

  void _onCancel() {
    _subscription.cancel();
    _subscription = null;
  }

  void _onData(String input) {<commit_msg>Fix error on strong mode<commit_after>import 'dart:async';
import 'dart:convert';

const int _LF = 10;
const int _CR = 13;

/// Provide Stream class for Twitter user Stream.
class TwitterStream extends Stream<Object> {
  Stream<String> _source;
  StreamSubscription<Object> _subscription;
  StreamController<Object> _controller;
  String _piecetweet = "";
  JsonDecoder _decoder = new JsonDecoder();

  TwitterStream(Stream<String> source) : _source = source {
    _controller = new StreamController<Object>(
        onListen: _onListen,
        onPause: _onPause,
        onResume: _onResume,
        onCancel: _onCancel);
  }

  StreamSubscription<Object> listen(void onData(Object tweet),
      {Function onError, void onDone(), bool cancelOnError}) {
    return _controller.stream.listen(onData,
        onError: onError, onDone: onDone, cancelOnError: cancelOnError);
  }

  void _onListen() {
    _subscription =
        _source.listen(_onData, onError: _controller.addError, onDone: _onDone);
  }

  void _onPause() {
    _subscription.pause();
  }

  void _onResume() {
    _subscription.resume();
  }

  void _onCancel() {
    _subscription.cancel();
    _subscription = null;
  }

  void _onData(String input) {
{'fraction_non_alphanumeric': 0.10655737704918032, 'fraction_numerical': 0.003278688524590164, 'mean_word_length': 3.7862745098039214, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '745677', 'n_tokens_mistral': 776, 'n_tokens_neox': 765, 'n_words': 185}