<commit_before>
class Vector {
  Vector(x, y) {
    this.x = x_;
    this.y = y_;
  }
  add(vector) {
    this.x += vector.x;
    this.y += vector.y;
  }
  sub(vector) {
    this.x -= vector.x;
    this.y -= vector.y;
  }
}<commit_msg>Added angle and magnitude properties<commit_after>
class Vector {
  constructor(x, y) {
    this.x = x_;
    this.y = y_;
    this.angle = {
      get angle () {
        return Math.atan2(this.x, this.y);
      },
      set angle (val) {
        var l = Math.sqrt(this.x * this.x + this.y * this.y);
        this.x = Math.cos(val) * l;
        this.y = Math.sin(val) * l;
      }
    }
    this.magnitude = {
      get magnitude () {
        return Math.sqrt(this.x * this.x + this.y * this.y);
      },
      set magnitude (val) {
        var angle = Math.atan2(this.x, this.y);
        this.x = Math.cos(angle) * val;
        this.y = Math.sin(angle) * val;
      }
    }
  }
  add(vector) {
    this.x += vector.x;
    this.y += vector.y;
  }
  sub(vector) {
    this.x -= vector.x;
    this.y -= vector.y;
  }
  multiply(scalar) {
    this.x *= scalar;
    this.y *= scalar;
  }
}
{'fraction_non_alphanumeric': 0.17158176943699732, 'fraction_numerical': 0.0017873100983020554, 'mean_word_length': 1.6923076923076923, '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': '4610459', 'n_tokens_mistral': 440, 'n_tokens_neox': 437, 'n_words': 89}