<commit_before>'use strict';

function fill(){
    if(!window.confirm('Set every pixel to ' + document.getElementById('color').value + '?')){
        return;
    }

    var loop_counter = pixelcount - 1;
    do{
        update_pixel(document.getElementById(loop_counter));
    }while(loop_counter--);
}

function grid_toggle(){
    // If buttons don't currently have borders, add borders.
    var border_width = document.getElementById(0).style.borderWidth != '1px'
      ? '1px'
      : 0;

    var loop_counter = pixelcount - 1;
    do{
        document.getElementById(loop_counter).style.borderWidth = border_width;
    }while(loop_counter--);
}

function hover_pixel(pixel){
    var dimensions = parseInt(
      document.getElementById('dimensions').value,
      10
    );

    document.getElementById('color-hover').value = pixel.style.backgroundColor || 'rgb(0, 0, 0)';
    document.getElementById('x').innerHTML = dimensions - pixel.id % dimensions;
    document.getElementById('y').innerHTML = dimensions - Math.floor(pixel.id / dimensions);
}

function setup_dimensions(skip){
    var element = document.getElementById('dimensions');
    var dimensions = element.value;

    if(!skip){
        dimensions = window.prompt(
          'Enter number of pixels on one side:',
          dimensions
        );

        if(dimensions == null){
            return;
        }

        dimensions = parseInt(
          dimensions,
          10
        );
    }

    element.value = dimensions;
    pixelcount = Math.pow(dimensions, 2);<commit_msg>made x and y always have at least two digits<commit_after>'use strict';

function fill(){
    if(!window.confirm('Set every pixel to ' + document.getElementById('color').value + '?')){
        return;
    }

    var loop_counter = pixelcount - 1;
    do{
        update_pixel(document.getElementById(loop_counter));
    }while(loop_counter--);
}

function grid_toggle(){
    // If buttons don't currently have borders, add borders.
    var border_width = document.getElementById(0).style.borderWidth != '1px'
      ? '1px'
      : 0;

    var loop_counter = pixelcount - 1;
    do{
        document.getElementById(loop_counter).style.borderWidth = border_width;
    }while(loop_counter--);
}

function hover_pixel(pixel){
    var dimensions = parseInt(
      document.getElementById('dimensions').value,
      10
    );

    document.getElementById('color-hover').value = pixel.style.backgroundColor || 'rgb(0, 0, 0)';

    var x = dimensions - pixel.id % dimensions;
    if(x < 10){
        x = '0' + x;
    }
    document.getElementById('x').innerHTML = x;

    var y = dimensions - Math.floor(pixel.id / dimensions);
    if(y < 10){
        y = '0' + y;
    }
    document.getElementById('y').innerHTML = y;
}

function setup_dimensions(skip){
    var element = document.getElementById('dimensions');
    var dimensions = element.value;

    if(!skip){
        dimensions = window.prompt(
          'Enter number of pixels on one side:',
          dimensions
        );

        if(dimensions == null){
            return;
        }

        dimensions = parseInt(
          dimensions,
          10
        );
    }

    element.value = dimensions;
    pixelcount = Math.pow(dimensions, 2);
{'fraction_non_alphanumeric': 0.12843470206853969, 'fraction_numerical': 0.010497066995986416, 'mean_word_length': 2.576158940397351, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2579163', 'n_tokens_mistral': 939, 'n_tokens_neox': 911, 'n_words': 208}