<commit_before>
<svg version="1.1" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="800" height="540" onload="init(evt)" onmousemove="drag(evt)" onmouseup="deselect()">
        <style>
        .point1{
            fill: #28A86B;
        }
        .point2{
            fill: #6495ED;
        }
		text {
		  font-size: 20px;
		  cursor: default;
		  font-family: Tahoma, Geneva, sans-serif;
		}
        .control_point{
            fill: #FFF;
            opacity: 0;
            stroke: #888;
            stroke-width: 2;
            cursor: pointer;
        }
		.moveable{
			cursor: move;	
		}
		.locked {
			cursor: default;	
		}
        .control_point:hover{
            opacity: 0.5;
        }
        .invisible{
            pointer-events: none;
        }
    </style>
    <script type="text/ecmascript"><![CDATA[
        var svgDoc;
        var selectedPoint = 0;
        var dx = 0;
        var dy = 0;
        
        var example_shape;
        var coords = [0, 0, 400, 300, 400, 200, 400, 100];
		var locked = [0, 0, 220, 200, 220, 40, 220, 380];
    	function lockPosition(evt, point){			
			evt.target.removeAttribute('onmousedown');
			evt.target.removeAttribute('onmouseup');
			var x = locked[point*2];
			var y = locked[point*2+1];
			var xo = coords[point*2];
			var yo = coords[point*2+1];
			if (Math.abs(yo-y) < 50){
				document.getElementById(point).setAttribute('fill','green');
			} else {
				if (yo < y){
					 document.getElementById(point).setAttribute('fill','rgb(200,60,50)');
				 } else {
					 document.getElementById(point).setAttribute('fill','rgb(28,105,180)');
				 }
			}
			sweepMove(evt.target.parentNode, x, y, xo, yo);
			evt.target.parentNode.setAttribute('class','locked');
		}
        function init(evt) {
            if ( window.svgDocument == null ) {
                svgDoc = evt.target.ownerDocument;
            }  
            example_shape = svgDoc.getElementById('example_shape');
        };
        
        function selectElement(evt, point){
            selectedPoint = point;
            control_point = evt.target.parentNode;
            dx = coords[selectedPoint*2] - evt.clientX;
            dy = coords[selectedPoint*2 + 1] - evt.clientY;
        };
        
        function drag(evt){
            if (selectedPoint === 0) { return; }
            var x = evt.clientX + dx;
            var y = evt.clientY + dy;
            coords[selectedPoint*2] = x;
            coords[selectedPoint*2 + 1] = y;
            
            control_point.setAttributeNS(null, "transform", "translate(" + x + "," + y + ")");
        };
        
		function sweepMove(evt, x, y, xo, yo){
			var i = 0;
			var numSteps = 20;<commit_msg>no losing outside of bounds<commit_after>
<svg version="1.1" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" width="800" height="540" onload="init(evt)" onmousemove="drag(evt)" onmouseup="deselect()">
        <style>
        .point1{
            fill: #28A86B;
        }
        .point2{
            fill: #6495ED;
        }
		text {
		  font-size: 20px;
		  cursor: default;
		  font-family: Tahoma, Geneva, sans-serif;
		}
        .control_point{
            fill: #FFF;
            opacity: 0;
            stroke: #888;
            stroke-width: 2;
            cursor: pointer;
        }
		.moveable{
			cursor: move;	
		}
		.locked {
			cursor: default;	
		}
        .control_point:hover{
            opacity: 0.5;
        }
        .invisible{
            pointer-events: none;
        }
    </style>
    <script type="text/ecmascript"><![CDATA[
        var svgDoc;
        var selectedPoint = 0;
        var dx = 0;
        var dy = 0;
        
        var example_shape;
        var coords = [0, 0, 400, 300, 400, 200, 400, 100];
		var locked = [0, 0, 220, 200, 220, 40, 220, 380];
    	function lockPosition(evt, point){			
			evt.target.removeAttribute('onmousedown');
			evt.target.removeAttribute('onmouseup');
			var x = locked[point*2];
			var y = locked[point*2+1];
			var xo = coords[point*2];
			var yo = coords[point*2+1];
			if (Math.abs(yo-y) < 50){
				document.getElementById(point).setAttribute('fill','green');
			} else {
				if (yo < y){
					 document.getElementById(point).setAttribute('fill','rgb(200,60,50)');
				 } else {
					 document.getElementById(point).setAttribute('fill','rgb(28,105,180)');
				 }
			}
			sweepMove(evt.target.parentNode, x, y, xo, yo);
			evt.target.parentNode.setAttribute('class','locked');
		}
        function init(evt) {
            if ( window.svgDocument == null ) {
                svgDoc = evt.target.ownerDocument;
            }  
            example_shape = svgDoc.getElementById('example_shape');
        };
        
        function selectElement(evt, point){
            selectedPoint = point;
            control_point = evt.target.parentNode;
            dx = coords[selectedPoint*2] - evt.clientX;
            dy = coords[selectedPoint*2 + 1] - evt.clientY;
        };
        
        function drag(evt){
            if (selectedPoint === 0) { return; }
            var x = evt.clientX + dx;
            var y = evt.clientY + dy;
			if (y > 450){
				y = 450;
			}
			if (y < 0){
				y = 0;
			}
			if (x > 700){
				x = 700;
			}
            coords[selectedPoint*2] = x;
            coords[selectedPoint*2 + 1] = y;
            
            control_point.setAttributeNS(null, "transform", "translate(" + x + "," + y + ")");
        };
        
		function sweepMove(evt, x, y, xo, yo){
			var i = 0;
			var numSteps = 20;
{'fraction_non_alphanumeric': 0.1474045939591246, 'fraction_numerical': 0.04304575872671369, 'mean_word_length': 1.8608380755302638, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 4}, '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': '2453625', 'n_tokens_mistral': 2129, 'n_tokens_neox': 1822, 'n_words': 374}