<commit_before>import Shape

class Rect extends Shape {
   var mUpperLeft:Point;
   var mLowerRight:Point;
   //returns an array of shapes that is this shape intersected
   function Rect(upperLeft:Point,lowerRight:Point) {
      mUpperLeft=upperLeft;
      mLowerRight=lowerRight;
   }
   function isValid() :Boolean{
      return mUpperLeft.x<mLowerRight.x&&mUpperLeft.y<mLowerRight.y;
   }
   function drawBox(sprite:Sprite, fillColor:Number, fillAlpha:Number) {
       sprite.drawBoxOutline(mUpperLeft,mLowerRight,0,0xffffff,0,fillColor,fillAlpha);
   }
   function toString():String {
      return "["+mUpperLeft.toString()+"-"+mLowerRight+"]";
   }
   function cutOutShape(unboundDeleteShape):Array  {
       var a=new Array();
       a.push(unboundDeleteShape);
       if (unboundDeleteShape.typeOf()=="Rect") {
           var deleteShape=new Rect(unboundDeleteShape.mUpperLeft.maximum(mUpperLeft).minimum(mLowerRight),
                                unboundDeleteShape.mLowerRight.minimum(mLowerRight).maximum(mUpperLeft));
           var r0=new Rect(new Point(mUpperLeft.x,mUpperLeft.y),
                        new Point(deleteShape.mUpperLeft.x,mLowerRight.y));
           var r1=new Rect(new Point(deleteShape.mUpperLeft.x,mUpperLeft.y),
                        new Point(deleteShape.mLowerRight.x,deleteShape.mUpperLeft.y));
           var r2=new Rect(new Point(deleteShape.mUpperLeft.x,deleteShape.mLowerRight.y),
                        new Point(deleteShape.mLowerRight.x,mLowerRight.y));
           var r3=new Rect(new Point(deleteShape.mLowerRight.x,mUpperLeft.y),
                        new Point(mLowerRight.x,mLowerRight.y));
           var retval=new Array();

           if (r0.isValid()) {
              retval.push(r0);
           }
           if (r1.isValid()) {
              retval.push(r1);
           }
           if (r2.isValid()) {
              retval.push(r2);
           }
           if (r3.isValid()) {
              retval.push(r3);
           }
           return retval;
       }
   }
   function typeOf():String { return "Rect";}
}<commit_msg>made it so if you draw a erase box from bottom to top it still works<commit_after>import Shape

class Rect extends Shape {
   var mUpperLeft:Point;
   var mLowerRight:Point;
   //returns an array of shapes that is this shape intersected
   function Rect(upperLeft:Point,lowerRight:Point) {
      mUpperLeft=upperLeft.minimum(lowerRight);
      mLowerRight=upperLeft.maximum(lowerRight);
   }
   function isValid() :Boolean{
      return mUpperLeft.x<mLowerRight.x&&mUpperLeft.y<mLowerRight.y;
   }
   function drawBox(sprite:Sprite, fillColor:Number, fillAlpha:Number) {
       sprite.drawBoxOutline(mUpperLeft,mLowerRight,0,0xffffff,0,fillColor,fillAlpha);
   }
   function toString():String {
      return "["+mUpperLeft.toString()+"-"+mLowerRight+"]";
   }
   function cutOutShape(unboundDeleteShape):Array  {
       var a=new Array();
       a.push(unboundDeleteShape);
       if (unboundDeleteShape.typeOf()=="Rect") {
           var deleteShape=new Rect(unboundDeleteShape.mUpperLeft.maximum(mUpperLeft).minimum(mLowerRight),
                                unboundDeleteShape.mLowerRight.minimum(mLowerRight).maximum(mUpperLeft));
           var r0=new Rect(new Point(mUpperLeft.x,mUpperLeft.y),
                        new Point(deleteShape.mUpperLeft.x,mLowerRight.y));
           var r1=new Rect(new Point(deleteShape.mUpperLeft.x,mUpperLeft.y),
                        new Point(deleteShape.mLowerRight.x,deleteShape.mUpperLeft.y));
           var r2=new Rect(new Point(deleteShape.mUpperLeft.x,deleteShape.mLowerRight.y),
                        new Point(deleteShape.mLowerRight.x,mLowerRight.y));
           var r3=new Rect(new Point(deleteShape.mLowerRight.x,mUpperLeft.y),
                        new Point(mLowerRight.x,mLowerRight.y));
           var retval=new Array();

           if (r0.isValid()) {
              retval.push(r0);
           }
           if (r1.isValid()) {
              retval.push(r1);
           }
           if (r2.isValid()) {
              retval.push(r2);
           }
           if (r3.isValid()) {
              retval.push(r3);
           }
           return retval;
       }
   }
   function typeOf():String { return "Rect";}
}
{'fraction_non_alphanumeric': 0.11643192488262911, 'fraction_numerical': 0.007042253521126761, 'mean_word_length': 2.3979266347687402, 'pattern_counts': {'":': 0, '<': 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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7205565', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1296, 'n_words': 205}