<commit_before>// function completer.
//
// completer should be a class that take an cell instance
var IPython = (function (IPython) {
    // that will prevent us from misspelling
    "use strict";

    // easyier key mapping
    var key = IPython.utils.keycodes;

    function prepend_n_prc(str, n) {
        for( var i =0 ; i< n ; i++)
        { str = '%'+str }
        return str;
    }

    function _existing_completion(item, completion_array){
       for( var c in completion_array ) {
           if(completion_array[c].substr(-item.length) == item)
           { return true; }
       }
       return false;
    }

    // what is the common start of all completions
    function shared_start(B, drop_prct) {
        if (B.length == 1) {
            return B[0];
        }
        var A = new Array();
        var common;
        var min_lead_prct = 10;
        for (var i = 0; i < B.length; i++) {
            var str = B[i].str;
            var localmin = 0;
            if(drop_prct == true){
                while ( str.substr(0, 1) == '%') {
                    localmin = localmin+1;<commit_msg>Fix duplicate completion in notebook<commit_after>// function completer.
//
// completer should be a class that take an cell instance
var IPython = (function (IPython) {
    // that will prevent us from misspelling
    "use strict";

    // easyier key mapping
    var key = IPython.utils.keycodes;

    function prepend_n_prc(str, n) {
        for( var i =0 ; i< n ; i++)
        { str = '%'+str }
        return str;
    }

    function _existing_completion(item, completion_array){
        for( var c in completion_array ) {
            if(completion_array[c].trim().substr(-item.length) == item)
            { return true; }
        }
       return false;
    }

    // what is the common start of all completions
    function shared_start(B, drop_prct) {
        if (B.length == 1) {
            return B[0];
        }
        var A = new Array();
        var common;
        var min_lead_prct = 10;
        for (var i = 0; i < B.length; i++) {
            var str = B[i].str;
            var localmin = 0;
            if(drop_prct == true){
                while ( str.substr(0, 1) == '%') {
                    localmin = localmin+1;
{'fraction_non_alphanumeric': 0.11798753339269813, 'fraction_numerical': 0.008904719501335707, 'mean_word_length': 1.7269417475728155, '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': '5030225', 'n_tokens_mistral': 717, 'n_tokens_neox': 685, 'n_words': 211}