<commit_before>var MiniPieLib = {};

	/**
	 * Method to draw a two-piece pie chart in a canvas
	 * @param {Object} ctx the canvas component to draw in (here, the canvas tag)
	 * @param {int} x centre of pie on x axis relative to top right of ctx
	 * @param {int} y centre of pie on y axis relative to top right of ctx
	 * @param {int} size size of the pie chart
	 * @param {String} color colour for the slice associsted with value param 
	 * @param {int} value size of the slice in degrees

	 */
MiniPieLib.drawMiniPie = function(ctx, x, y, size, color, value)
{
    ctx.save();
    ctx.fillStyle = color;
    ctx.strokeStyle = color;
    ctx.moveTo(x, y);        
    // draw circle
    ctx.beginPath();
    ctx.arc(x,y,size/2, Math.PI*3/2 , Math.PI*3/2+(Math.PI*2),false);
    ctx.stroke();
    // draw slice
    ctx.beginPath();
    ctx.moveTo(x, y);        
    ctx.arc(x,y,size/2, Math.PI*3/2 , Math.PI*3/2+(Math.PI/180)*value,false);
    ctx.lineTo(x,y);
    ctx.fill();
    
    ctx.restore();			
}

	/**
	 * Method to draw a two-colour two-piece pie chart in a canvas
	 * @param {Object} ctx the canvas component to draw in (here, the canvas tag)
	 * @param {int} x centre of pie on x axis relative to top right of ctx
	 * @param {int} y centre of pie on y axis relative to top right of ctx
	 * @param {int} size size of the pie chart
	 * @param {String} colour one colour for the pie
	 * @param {String} sliceColour the other colour for the slice, the one associsted with value param 
	 * @param {int} value corresponds to the size of the slice
	 * @param {String} outlineColour the colour for the outline of the circle
	 */
function drawTwoColourMiniPie(ctx, x, y, size, colour, sliceColour, value, outlineColour){
	    ctx.save();
	    ctx.fillStyle = colour;
	    ctx.strokeStyle = colour;
	    ctx.moveTo(x, y);
	    // draw circle
	    ctx.beginPath();
	    ctx.arc(x,y,size/2, Math.PI*3/2 , Math.PI*3/2+(Math.PI*2),false);
	    ctx.fill();
	    // draw slice
	    ctx.fillStyle = sliceColour;
	    ctx.beginPath();
	    ctx.moveTo(x, y);        
	    ctx.arc(x,y,size/2, Math.PI*3/2 , Math.PI*3/2+(Math.PI/180)*value,false);
	    ctx.lineTo(x,y);
	    ctx.fill();
		// draw circle outline
	    ctx.beginPath();
	    ctx.arc(x,y,size/2, Math.PI*3/2 , Math.PI*3/2+(Math.PI*2),false);
	    ctx.strokeStyle = outlineColour;
	    ctx.stroke();
	    
	    ctx.restore();			
	}<commit_msg>made two-colour method actually a two-slice method<commit_after>var MiniPieLib = {};

	/**
	 * Method to draw a two-piece pie chart in a canvas
	 * @param {Object} ctx the canvas component to draw in (here, the canvas tag)
	 * @param {int} x centre of pie on x axis relative to top right of ctx
	 * @param {int} y centre of pie on y axis relative to top right of ctx
	 * @param {int} size size of the pie chart
	 * @param {String} color colour for the slice associsted with value param 
	 * @param {int} value size of the slice in degrees

	 */
MiniPieLib.drawMiniPie = function(ctx, x, y, size, color, value)
{
    ctx.save();
    ctx.fillStyle = color;
    ctx.strokeStyle = color;
    ctx.moveTo(x, y);        
    // draw circle
    ctx.beginPath();
    ctx.arc(x,y,size/2, Math.PI*3/2 , Math.PI*3/2+(Math.PI*2),false);
    ctx.stroke();
    // draw slice
    ctx.beginPath();
    ctx.moveTo(x, y);        
    ctx.arc(x,y,size/2, Math.PI*3/2 , Math.PI*3/2+(Math.PI/180)*value,false);
    ctx.lineTo(x,y);
    ctx.fill();
    
    ctx.restore();			
}

	/**
	 * Method to draw a two-colour, two-piece pie chart in a canvas (where sum of pieces can be < total)
	 * @param {Object} ctx the canvas component to draw in (here, the canvas tag)
	 * @param {int} x centre of pie on x axis relative to top right of ctx
	 * @param {int} y centre of pie on y axis relative to top right of ctx
	 * @param {int} size size of the pie chart
	 * @param {String} colourOne colour for slice one of the pie
	 * @param {int} valueOne size of slice one in degrees
	 * @param {String} colourTwo colour for slice two of the pie
	 * @param {int} valueTwo size of slice two in degrees
	 */
function drawTwoColourMiniPie(ctx, x, y, size, colourOne, valueOne, colourTwo, valueTwo){
	    ctx.save();
	    ctx.fillStyle = '#E0E0E0';
	    ctx.moveTo(x, y);
	    // draw circle
	    ctx.beginPath();
	    ctx.arc(x,y,size/2, Math.PI*3/2 , Math.PI*3/2+(Math.PI*2),false);
	    ctx.fill();
	    // draw slice one
	    ctx.fillStyle = colourOne;
	    ctx.beginPath();
	    ctx.moveTo(x, y);        
	    ctx.arc(x,y,size/2, Math.PI*3/2 , Math.PI*3/2+(Math.PI/180)*valueOne,false);
	    ctx.lineTo(x,y);
	    ctx.fill();
	    // draw slice two
	    ctx.fillStyle = colourTwo;
	    ctx.beginPath();
	    ctx.moveTo(x, y);        
	    ctx.arc(x,y,size/2, Math.PI*3/2+(Math.PI/180)*valueOne ,
	    	Math.PI*3/2+(Math.PI/180)*valueOne+(Math.PI/180)*valueTwo,false);
	    ctx.lineTo(x,y);
	    ctx.fill();
		// draw circle outline
	    ctx.beginPath();
	    ctx.arc(x,y,size/2, Math.PI*3/2 , Math.PI*3/2+(Math.PI*2),false);
	    ctx.strokeStyle = 'black';
	    ctx.stroke();
	    
	    ctx.restore();			
	}
{'fraction_non_alphanumeric': 0.1420678768745067, 'fraction_numerical': 0.016771902131018153, 'mean_word_length': 2.732695139911635, 'pattern_counts': {'":': 0, '<': 4, '<?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': '5102948', 'n_tokens_mistral': 1873, 'n_tokens_neox': 1750, 'n_words': 553}