<commit_before>function Opcode(num) {
  if (!(this instanceof Opcode))
    return new Opcode(num);

  if (typeof num === 'number') {
    this.num = num;
  } else if (typeof num === 'string') {
    var str = num;
    this.num = Opcode.map[str];
  } else if (num) {
    var obj = num;
    this.set(obj);
  }
}

Opcode.prototype.set = function(obj) {
  this.num = typeof obj.num !== 'undefined' ? obj.num : this.num;
  return this;
};

Opcode.prototype.fromNumber = function(num) {
  this.num = num;
  return this;
};

Opcode.prototype.toNumber = function() {
  return this.num;
};

Opcode.prototype.fromString = function(str) {
  this.num = Opcode.map[str];
  return this;
};

Opcode.prototype.toString = function() {
  var str = Opcode.reverseMap[this.num];
  if (typeof str === 'undefined')
    throw new Error('Opcode does not have a string representation');
  return str;
};

Opcode.map = {
  // push value
  OP_FALSE: 0,
  OP_0: 0,<commit_msg>throw error for invalid strings<commit_after>function Opcode(num) {
  if (!(this instanceof Opcode))
    return new Opcode(num);

  if (typeof num === 'number') {
    this.num = num;
  } else if (typeof num === 'string') {
    var str = num;
    this.num = Opcode.map[str];
  } else if (num) {
    var obj = num;
    this.set(obj);
  }
}

Opcode.prototype.set = function(obj) {
  this.num = typeof obj.num !== 'undefined' ? obj.num : this.num;
  return this;
};

Opcode.prototype.fromNumber = function(num) {
  this.num = num;
  return this;
};

Opcode.prototype.toNumber = function() {
  return this.num;
};

Opcode.prototype.fromString = function(str) {
  var num = Opcode.map[str];
  if (typeof num === 'undefined')
    throw new Error('Invalid opcodestr');
  this.num = num;
  return this;
};

Opcode.prototype.toString = function() {
  var str = Opcode.reverseMap[this.num];
  if (typeof str === 'undefined')
    throw new Error('Opcode does not have a string representation');
  return str;
};

Opcode.map = {
  // push value
  OP_FALSE: 0,
  OP_0: 0,
{'fraction_non_alphanumeric': 0.15576635047428858, 'fraction_numerical': 0.0029955067398901645, 'mean_word_length': 3.2638297872340427, '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': '5780082', 'n_tokens_mistral': 691, 'n_tokens_neox': 699, 'n_words': 184}