<commit_before>(function() {
  function Spaceship( game ) {
    var self = this;
    
    var playerWidth = 20, playerHeight = 30;
    var playerVerts = [
      [ - 1 * playerHeight / 2, -1 * playerWidth / 2], 
      [ - 1 * playerHeight / 2, playerWidth / 2], 
      [playerHeight / 2, 0]
    ];    
    
    $.extend(self, {
      init: function() {
        self.position   = { x: 5, y: 5 };
        self.direction  = { x: 1, y: 1 };
        self.velocity   = 5;
        self.object     = new Image();
        self.object.src = "smiley.jpg";
        self.limits     = [400, 5, 225, 5];
        self.dimensions = {
          width: 150,
          height: 150
        }
      },
      draw: function() {
        game.paper.translate(self.position.x, self.position.y);
        // game.paper.rotate(that.dir.angle());
        
        game.util.tracePoly(playerVerts);
        
        game.paper.fillStyle = "white";
        game.paper.fill();
        
        game.util.tracePoly(playerVerts);
        
        game.paper.stroke();
        
        return self;
      },
      moveForward: function() {
        self.position.y -= self.velocity * self.direction.y;
        self.outOfBounds();
      },
      moveBackward: function() {
        self.position.y += self.velocity * self.direction.y;
        self.outOfBounds();
      },
      moveLeft: function() {
        self.position.x -= self.velocity * self.direction.x;
        self.outOfBounds();
      },
      moveRight: function() {
        self.position.x += self.velocity * self.direction.x;
        self.outOfBounds();
      },
      rotate: function() {
        game.paper.translate(self.dimensions.width / 2, self.dimensions.height / 2);
        game.paper.rotate(game.sineWave * Math.PI * 2);
        game.paper.translate(-(self.dimensions.width / 2), -(self.dimensions.height / 2));
      },
      outOfBounds: function() {
        var pos = self.position;
        
        if (pos.x >= self.limits[0]) {
          self.position.x = self.limits[0];
        } else if (pos.x <= self.limits[1]) {
          self.position.x = self.limits[1];
        }
        
        if (pos.y >= self.limits[2]) {
          self.position.y = self.limits[2];
        } else if (pos.y <= self.limits[3]) {
          self.position.y = self.limits[3];
        }
      }
    });
    
    self.init();
  };
  <commit_msg>renamed bounds check method<commit_after>(function() {
  function Spaceship( game ) {
    var self = this;
    
    var playerWidth = 20, playerHeight = 30;
    var playerVerts = [
      [ - 1 * playerHeight / 2, -1 * playerWidth / 2], 
      [ - 1 * playerHeight / 2, playerWidth / 2], 
      [playerHeight / 2, 0]
    ];    
    
    $.extend(self, {
      init: function() {
        self.position   = { x: 5, y: 5 };
        self.direction  = { x: 1, y: 1 };
        self.velocity   = 5;
        self.object     = new Image();
        self.object.src = "smiley.jpg";
        self.limits     = [400, 5, 225, 5];
        self.dimensions = {
          width: 150,
          height: 150
        }
      },
      
      draw: function() {
        game.paper.translate(self.position.x, self.position.y);
        // game.paper.rotate(that.dir.angle());
        
        game.util.tracePoly(playerVerts);
        
        game.paper.fillStyle = "white";
        game.paper.fill();
        
        game.util.tracePoly(playerVerts);
        
        game.paper.stroke();
        
        return self;
      },
      
      moveForward: function() {
        self.position.y -= self.velocity * self.direction.y;
        self.boundsCheck();
      },
      
      moveBackward: function() {
        self.position.y += self.velocity * self.direction.y;
        self.boundsCheck();
      },
      
      moveLeft: function() {
        self.position.x -= self.velocity * self.direction.x;
        self.boundsCheck();
      },
      
      moveRight: function() {
        self.position.x += self.velocity * self.direction.x;
        self.boundsCheck();
      },
      
      rotate: function() {
        game.paper.translate(self.dimensions.width / 2, self.dimensions.height / 2);
        game.paper.rotate(game.sineWave * Math.PI * 2);
        game.paper.translate(-(self.dimensions.width / 2), -(self.dimensions.height / 2));
      },
      
      boundsCheck: function() {
        var pos = self.position;
        
        if (pos.x >= self.limits[0]) {
          self.position.x = self.limits[0];
        } else if (pos.x <= self.limits[1]) {
          self.position.x = self.limits[1];
        }
        
        if (pos.y >= self.limits[2]) {
          self.position.y = self.limits[2];
        } else if (pos.y <= self.limits[3]) {
          self.position.y = self.limits[3];
        }
      }
    });
    
    self.init();
  };
  
{'fraction_non_alphanumeric': 0.15005224660397073, 'fraction_numerical': 0.018808777429467086, 'mean_word_length': 1.557990379476216, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '730187', 'n_tokens_mistral': 1578, 'n_tokens_neox': 1487, 'n_words': 275}