<commit_before>const notAllDefined = args => args === undefined || args.filter(arg => arg === undefined).length > 0;

class IOCore {
  constructor (ioFunc) {
    this.then = cb => ioFunc((...args) => {
      if (notAllDefined(args)) return;
      cb(...args)
    });
  };

  reject (pred) {
    let saveThen = this.then;
    this.then = cb => {
      saveThen((...args) => {
        let result = pred(...args);
        if (result !== null) {
          if (Array.isArray(result)) {
            cb(...result);
          } else {
            cb(result);
          }
        };
      });
    };
    return this;
  };

  maybeFalse (mv, handler) {
    let saveThen = this.then;
    this.then = cb => {
      saveThen((...args) => {
        let result = mv(...args);
        if (result === false) {
          handler(...args);
        } else {
          cb(...args);
        }
      });
    };
    return this;
  };

  maybeNull (mv, handler) {
    let saveThen = this.then;
    this.then = cb => {
      saveThen((...args) => {
        let result = mv(...args);
        if (result === null) {
          handler(...args);
        } else {
          cb(...args);
        }
      });
    };
    return this;
  };

  maybeErr (mv, handler) {
    let saveThen = this.then;
    this.then = cb => {
      saveThen((...args) => {
        let result = mv(...args);
        if (result instanceof Error) {
          handler(...args);
        } else {
          cb(...args);
        }
      });
    };
    return this;
  };

  maybeTrue (mv, handler) {
    let saveThen = this.then;
    this.then = cb => {
      saveThen((...args) => {
        let result = mv(...args);
        if (result === true) {
          handler(...args);
        } else {
          cb(...args);
        }
      });
    };
    return this;
  };

  maybeUndefined (mv, handler) {
    let saveThen = this.then;
    this.then = cb => {
      saveThen((...args) => {
        let result = mv(...args);
        if (result === undefined) {
          handler(...args);
        } else {
          cb(...args);
        }
      });
    };
    return this;
  };

  map (transform) {
    let saveThen = this.then;
    this.then = cb => {
      saveThen((...args) => {
        if (notAllDefined(args)) return;
        let result = transform(...args);
        if (Array.isArray(result)) {
          cb(...result);
        } else {
          cb(result);
        }
      });
    };
    return this;
  };

  bind (ioFunc) {
    let saveThen = this.then;
    this.then = cb => {
      saveThen((...args) => {
        if (notAllDefined(args)) return;
        let io = ioFunc(...args);
        io.then((...ioargs) => cb(...args, ...ioargs));
      });
    };
    return this;
  };

  static timer (s) {
    var intervalId;
    var timer = new IOCore(cb => {
      intervalId = setInterval(cb, Math.floor(s * 1000))
    });
    timer.clear = () => clearInterval(intervalId);
    return timer;
  };
<commit_msg>Handle parameter propagation in `IOCore`<commit_after>const notAllDefined = args => args === undefined || args.filter(arg => arg === undefined).length > 0;

class IOCore {
  constructor (ioFunc) {
    this.then = cb => ioFunc((...args) => {
      if (notAllDefined(args)) return;
      cb(...args)
    });
  };

  reject (pred) {
    let saveThen = this.then;
    this.then = cb => {
      saveThen((...args) => {
        let result = pred(...args);
        if (result !== null) {
          if (Array.isArray(result)) {
            cb(...result);
          } else {
            cb(result);
          }
        };
      });
    };
    return this;
  };

  maybeFalse (mv, handler) {
    let saveThen = this.then;
    this.then = cb => {
      saveThen((...args) => {
        let result = mv(...args);
        if (result === false) {
          handler(...args);
        } else {
          cb(...args);
        }
      });
    };
    return this;
  };

  maybeNull (mv, handler) {
    let saveThen = this.then;
    this.then = cb => {
      saveThen((...args) => {
        let result = mv(...args);
        if (result === null) {
          handler(...args);
        } else {
          cb(...args);
        }
      });
    };
    return this;
  };

  maybeErr (mv, handler) {
    let saveThen = this.then;
    this.then = cb => {
      saveThen((...args) => {
        let result = mv(...args);
        if (result instanceof Error) {
          handler(...args);
        } else {
          cb(...args);
        }
      });
    };
    return this;
  };

  maybeTrue (mv, handler) {
    let saveThen = this.then;
    this.then = cb => {
      saveThen((...args) => {
        let result = mv(...args);
        if (result === true) {
          handler(...args);
        } else {
          cb(...args);
        }
      });
    };
    return this;
  };

  maybeUndefined (mv, handler) {
    let saveThen = this.then;
    this.then = cb => {
      saveThen((...args) => {
        let result = mv(...args);
        if (result === undefined) {
          handler(...args);
        } else {
          cb(...args);
        }
      });
    };
    return this;
  };

  map (transform) {
    let saveThen = this.then;
    this.then = cb => {
      saveThen((...args) => {
        if (notAllDefined(args)) return;
        let result = transform(...args);
        if (Array.isArray(result)) {
          cb(...result);
        } else {
          cb(result);
        }
      });
    };
    return this;
  };

  bind (ioFunc) {
    let saveThen = this.then;
    this.then = cb => {
      saveThen((...args) => {
        args = ioFunc.length < args.length ? args.slice(0, ioFunc.length) : args
        let io = ioFunc(...args);
        io.then((...ioargs) => cb(...args, ...ioargs));
      });
    };
    return this;
  };

  static timer (s) {
    var intervalId;
    var timer = new IOCore(cb => {
      intervalId = setInterval(cb, Math.floor(s * 1000))
    });
    timer.clear = () => clearInterval(intervalId);
    return timer;
  };

{'fraction_non_alphanumeric': 0.18499244586201108, 'fraction_numerical': 0.0018465670639583682, 'mean_word_length': 1.4378068739770868, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 51, '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': '5789092', 'n_tokens_mistral': 1930, 'n_tokens_neox': 1909, 'n_words': 405}