<commit_before>part of colorize;

@proxy
class ColorizeString {

  static final String ESC = "\u{1B}";

  String initial = '';
  String wrapped = '';

  ColorizeString([this.initial = '']) {
    wrapped = initial;
  }

  String toString() {
    return wrapped;
  }

  ColorizeString noSuchMethod(Invocation mirror) {
    String style = MirrorSystem.getName(mirror.memberName);
    apply(style);

    return this;
  }

  ColorizeString call(String text) {
    this.initial = text;
    this.wrapped = text;
    return this;
  }

  String buildEscSeq(String style) {
    return ESC + "[${Styles.list[style]}m";
  }

  ColorizeString apply(String style, [String text]) {

    if (text == null) {
      text = wrapped;
    }

    wrapped = _stylize(style, text);
    return this;

  }

  String _stylize(String style, String text) {

    if (Styles.list.containsKey(style)) {
      return _applyStyle(style, text);
    }

    return text;
  }

  String _applyStyle(String style, String text) {
    return buildEscSeq(style) + text + buildEscSeq('reset');
  }

}<commit_msg>remove variable wrapped<commit_after>part of colorize;

@proxy
class ColorizeString {

  static final String ESC = "\u{1B}";

  String initial = '';

  ColorizeString([this.initial = '']);

  String toString() {
    return initial;
  }

  ColorizeString noSuchMethod(Invocation mirror) {
    String style = MirrorSystem.getName(mirror.memberName);
    apply(style);

    return this;
  }

  ColorizeString call(String text) {
    return new ColorizeString(text);
  }

  String buildEscSeq(String style) {
    return ESC + "[${Styles.list[style]}m";
  }

  ColorizeString apply(String style, [String text]) {

    if (text == null) {
      text = initial;
    }

    initial = _stylize(style, text);
    return this;

  }

  String operator +(ColorizeString string) {
    return this.toString() + string.toString();
  }

  String _stylize(String style, String text) {

    if (Styles.list.containsKey(style)) {
      return _applyStyle(style, text);
    }

    return text;
  }

  String _applyStyle(String style, String text) {
    return buildEscSeq(style) + text + buildEscSeq('reset');
  }

}
{'fraction_non_alphanumeric': 0.12297734627831715, 'fraction_numerical': 0.0009246417013407304, 'mean_word_length': 3.1455938697318007, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7221100', 'n_tokens_mistral': 721, 'n_tokens_neox': 682, 'n_words': 166}