<commit_before><div id='vis-<%= id %>'></div>
<script>
 require.config({paths: {
   Nyaplot: "<%= PATH_NYAPLOT %>"
 }});

 require(["Nyaplot"], function(Nyaplot){
   var vis_id = "vis-<%= id %>";
   var pr = Nyaplot.core.to_png('#'+vis_id, <%= model %>);

   function searchCell(uuid){
     var n = IPython.notebook.ncells();
     for(var i=0; i<n; i++){
       var cell = IPython.notebook.get_cell(i);
       var outputs = cell.output_area.outputs.filter(function(out){
         var html = out.data["text/html"];
         if(typeof html == "undefined")return false;
         if(html.includes(uuid))return true;
         return false;
       });
       if(outputs.length>0)return cell;
     }
     return null;
   }

   if(typeof window.IPython != "undefined"){
     pr.then(function(selection){
       try{
         var html = selection.node().outerHTML;
         var cell = searchCell(vis_id);
         if(cell == null)throw new Error("The cell whose id is " + vis_id + " not found.");
         cell.output_area.outputs[0].data["text/html"] = html;
       }
       catch(e){
         console.warn("Maybe the front-end API of Jupyter has changed.\nmessage:" + e.message);
       }
     });
   }
 });
</script>
<commit_msg>Enable to embed png to notebooks including Markdown cells<commit_after><div id='vis-<%= id %>'></div>
<script>
 require.config({paths: {
   Nyaplot: "<%= PATH_NYAPLOT %>"
 }});

 require(["Nyaplot"], function(Nyaplot){
   var vis_id = "vis-<%= id %>";
   var pr = Nyaplot.core.to_png('#'+vis_id, <%= model %>);

   function searchCell(uuid){
     var n = IPython.notebook.ncells();
     for(var i=0; i<n; i++){
       var cell = IPython.notebook.get_cell(i);
       if(typeof cell.output_area != "undefined"){
         var outputs = cell.output_area.outputs.filter(function(out){
           var html = out.data["text/html"];
           if(typeof html == "undefined")return false;
           if(html.includes(uuid))return true;
           return false;
         });
         if(outputs.length>0)return cell;
       }
     }
     return null;
   }

   if(typeof window.IPython != "undefined"){
     pr.then(function(selection){
       try{
         var html = selection.node().outerHTML;
         var cell = searchCell(vis_id);
         if(cell == null)throw new Error("The cell whose id is " + vis_id + " not found.");
         cell.output_area.outputs[0].data["text/html"] = html;
       }
       catch(e){
         console.warn("Maybe the front-end API of Jupyter has changed.\nmessage:" + e.message);
       }
     });
   }
 });
</script>

{'fraction_non_alphanumeric': 0.16965678627145087, 'fraction_numerical': 0.00234009360374415, 'mean_word_length': 2.5281980742778543, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '7464826', 'n_tokens_mistral': 864, 'n_tokens_neox': 835, 'n_words': 177}