<commit_before>var co = require('co');

var wrapco = function(handler) {
  return function(gen, opts) {
    opts = opts || {};

    return co(gen).catch(function(error) {
      // be totally safe in case handler errors out
      try {
        handler.call(opts.ctx, error, opts);
      } catch (e) {
        console.error('ERROR: Safeco error handler threw:', e.stack);
      }
    });
  };
};

module.exports = function(gen, opts) {
  var handler;
  if (isGeneratorFunction(gen)) {
    // using safeco on a generator, proceed with the default handler
    handler = function(err) {
      console.error('Unhanded co Error', err.stack);
    };
    return wrapco(handler)(gen, opts);
  } else {
    // a custom handler is passed in, return the wrapper
    handler = gen;
    return wrapco(handler);
  }
};

<commit_msg>Linting safeco.js<commit_after>'use strict';

var co = require('co');

var wrapco = function(handler) {
  return function(gen, opts) {
    opts = opts || {};

    return co(gen).catch(function(error) {
      // be totally safe in case handler errors out
      try {
        handler.call(opts.ctx, error, opts);
      }
      catch (e) {
        console.error('ERROR: Safeco error handler threw:', e.stack);
      }
    });
  };
};

module.exports = function(gen, opts) {
  var handler;
  if (isGeneratorFunction(gen)) {
    // using safeco on a generator, proceed with the default handler
    handler = function(err) {
      console.error('Unhanded co Error', err.stack);
    };
    return wrapco(handler)(gen, opts);
  }
  else {
    // a custom handler is passed in, return the wrapper
    handler = gen;
    return wrapco(handler);
  }
};


{'fraction_non_alphanumeric': 0.1350210970464135, 'fraction_numerical': 0.0, 'mean_word_length': 2.688888888888889, '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': '3458941', 'n_tokens_mistral': 515, 'n_tokens_neox': 506, 'n_words': 149}