<commit_before>(function (window, $, undefined) {
  'use strict';
  var FlyByWire;
  FlyByWire = function Example(cockpit) {
    console.log('Loading FlyByWire plugin in the browser.');
    // Instance variables
    this.cockpit = cockpit;
    this.flybywireControlActive = false;
    this.originalsettings = {};
    this.leftx = 0;
    this.lefty = 0;
    this.rightx = 0;
    this.righty = 0;
    this.lift = 0;
    this.targetHeading = 0;
    this.targetDepth = 0;
    this.targetThrottle = 0;
    this.maxDegreeOfHeadingChange = 5;
    this.maxDepthChange = 0.1;
    // Add required UI elements
    $('#keyboardInstructions').append('<p><i>g</i> to toggle flybywire</p>');
    this.listen();
  };
  FlyByWire.prototype.listen = function listen() {
    var rov = this;
    KEYS[71] = {
      keydown: function () {
        rov.toggleControl();
      }
    };
    // g
    cockpitEventEmitter.on('rovpilot.control_update', function (controls) {
      if (rov.flybywireControlActive) {
        rov.processControlChanges(controls);
      }
    });
    this.cockpit.socket.on('navdata', function (data) {
      if (!jQuery.isEmptyObject(data)) {
        data.hdgd();
      }
    });
  };
  FlyByWire.prototype.processControlChanges = function processControlChanges(controls) {
    if (controls.throttle != this.targetThrottle) {
      this.targetThrottle = controls.throttle;
      this.cockpit.socket.emit('thro', controls.throttle);
    }
    if (controls.yaw !== 0) {
      this.targetHeading += this.maxDegreeOfHeadingChange * controls.yaw;
      if (this.targetHeading >= 360)
        this.targetHeading -= 360;
      if (this.targetHeading < 0)
        this.targetHeading += 360;
      this.cockpit.socket.emit('holdHeading_on', this.targetHeading);
    }
    if (controls.lift !== 0) {
      if (controls.lift < 0 && this.targetDepth <= 0)
        return;<commit_msg>Removed bogus code causing js errors in flybywire<commit_after>(function (window, $, undefined) {
  'use strict';
  var FlyByWire;
  FlyByWire = function Example(cockpit) {
    console.log('Loading FlyByWire plugin in the browser.');
    // Instance variables
    this.cockpit = cockpit;
    this.flybywireControlActive = false;
    this.originalsettings = {};
    this.leftx = 0;
    this.lefty = 0;
    this.rightx = 0;
    this.righty = 0;
    this.lift = 0;
    this.targetHeading = 0;
    this.targetDepth = 0;
    this.targetThrottle = 0;
    this.maxDegreeOfHeadingChange = 5;
    this.maxDepthChange = 0.1;
    // Add required UI elements
    $('#keyboardInstructions').append('<p><i>g</i> to toggle flybywire</p>');
    this.listen();
  };
  FlyByWire.prototype.listen = function listen() {
    var rov = this;
    KEYS[71] = {
      keydown: function () {
        rov.toggleControl();
      }
    };
    // g
    cockpitEventEmitter.on('rovpilot.control_update', function (controls) {
      if (rov.flybywireControlActive) {
        rov.processControlChanges(controls);
      }
    });

  };
  FlyByWire.prototype.processControlChanges = function processControlChanges(controls) {
    if (controls.throttle != this.targetThrottle) {
      this.targetThrottle = controls.throttle;
      this.cockpit.socket.emit('thro', controls.throttle);
    }
    if (controls.yaw !== 0) {
      this.targetHeading += this.maxDegreeOfHeadingChange * controls.yaw;
      if (this.targetHeading >= 360)
        this.targetHeading -= 360;
      if (this.targetHeading < 0)
        this.targetHeading += 360;
      this.cockpit.socket.emit('holdHeading_on', this.targetHeading);
    }
    if (controls.lift !== 0) {
      if (controls.lift < 0 && this.targetDepth <= 0)
        return;
{'fraction_non_alphanumeric': 0.13510550835845436, 'fraction_numerical': 0.014798574952041656, 'mean_word_length': 2.7863070539419086, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 13, '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': '6977340', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1182, 'n_words': 224}