<commit_before>var Z1 = (function(global) {
  var seq = 0;
  var jobs = [];
  var bcastdata = {};
  var cls = {};

  function mkJobID() {
    return "job-" + ++seq;
  };

  cls.log = function() {
    var parts = [];

    for (var i = 0; i < arguments.length; ++i) {
      parts.push(String(arguments[i]));
    }

    z1_log(parts.join(", "));
  }

  cls.broadcast = function() {
    for (var i = 0; i < arguments.length; ++i) {
      var var_name = arguments[i];

      if (typeof var_name != "string")  {
        throw "arguments to Z1.broadcast must be strings";
      }

      if (var_name == "params") {
        throw "'params' is a reserved variable and cannot be broadcasted";
      }

      if (!global[var_name]) {
        throw "no such variable: " + var_name;
      }

      bcastdata[var_name] = String(global[var_name]);
    }
  };

  cls.mapTable = function(opts) {
    var job_id = mkJobID();

    jobs.push({
      id: job_id,
      op: "map_table",
      table_name: opts["table"],
      from: opts["from"],
      until: opts["until"],
      map_fn: String(opts["map_fn"]),
      globals: JSON.stringify(bcastdata),
      params: JSON.stringify({ "fu": 123 })
    });

    return job_id;
  };

  cls.reduce = function(opts) {
    var job_id = mkJobID();

    jobs.push({
      id: job_id,
      op: "reduce",
      sources: opts["sources"],
      num_shards: opts["shards"],
      reduce_fn: String(opts["reduce_fn"]),
      globals: JSON.stringify(bcastdata),
      params: JSON.stringify({ "fu": 123 })
    });

    return job_id;
  };

  cls.downloadResults = function(sources) {
    var job_id = mkJobID();

    jobs.push({
      id: job_id,
      op: "return_results",
      sources: sources
    });

    z1_executemr(JSON.stringify(jobs), job_id);
  };

  cls.saveToTable = function(opts) {<commit_msg>pass task params<commit_after>var Z1 = (function(global) {
  var seq = 0;
  var jobs = [];
  var bcastdata = {};
  var cls = {};

  function mkJobID() {
    return "job-" + ++seq;
  };

  cls.log = function() {
    var parts = [];

    for (var i = 0; i < arguments.length; ++i) {
      parts.push(String(arguments[i]));
    }

    z1_log(parts.join(", "));
  }

  cls.broadcast = function() {
    for (var i = 0; i < arguments.length; ++i) {
      var var_name = arguments[i];

      if (typeof var_name != "string")  {
        throw "arguments to Z1.broadcast must be strings";
      }

      if (var_name == "params") {
        throw "'params' is a reserved variable and cannot be broadcasted";
      }

      if (!global[var_name]) {
        throw "no such variable: " + var_name;
      }

      bcastdata[var_name] = String(global[var_name]);
    }
  };

  cls.mapTable = function(opts) {
    var job_id = mkJobID();

    jobs.push({
      id: job_id,
      op: "map_table",
      table_name: opts["table"],
      from: opts["from"],
      until: opts["until"],
      map_fn: String(opts["map_fn"]),
      globals: JSON.stringify(bcastdata),
      params: JSON.stringify(opts["params"] || {})
    });

    return job_id;
  };

  cls.reduce = function(opts) {
    var job_id = mkJobID();

    jobs.push({
      id: job_id,
      op: "reduce",
      sources: opts["sources"],
      num_shards: opts["shards"],
      reduce_fn: String(opts["reduce_fn"]),
      globals: JSON.stringify(bcastdata),
      params: JSON.stringify(opts["params"] || {})
    });

    return job_id;
  };

  cls.downloadResults = function(sources) {
    var job_id = mkJobID();

    jobs.push({
      id: job_id,
      op: "return_results",
      sources: sources
    });

    z1_executemr(JSON.stringify(jobs), job_id);
  };

  cls.saveToTable = function(opts) {
{'fraction_non_alphanumeric': 0.16371077762619374, 'fraction_numerical': 0.005457025920873124, 'mean_word_length': 2.416589002795899, 'pattern_counts': {'":': 2, '<': 7, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6588884', 'n_tokens_mistral': 1297, 'n_tokens_neox': 1250, 'n_words': 282}