<commit_before>Bokeh.Collections.register_models({
  {% for name, impl in custom_models.items() -%}
    "{{ name }}": {{ impl }},
  {%- endfor %}
});
var docs_json = {{ docs_json }};
var docs = {};
for (key in docs_json) {
  docs[key] = Bokeh.Document.from_json(docs_json[key]);
}
var render_items = {{ render_items }};
for (idx in render_items) {
  var item = render_items[idx];
  var elem = Bokeh.$('#' + item['elementid']);
  if ('modelid' in item && item['modelid'] !== null) {
    if ('docid' in item && item['docid'] !== null) {
      Bokeh.embed.add_model_static(elem, item['modelid'], docs[item['docid']]);
    } else {
      Bokeh.embed.add_model_from_session(elem, item['modelid'], item['sessionid']);
    }
  } else {
    if ('docid' in item && item['docid'] !== null) {
       Bokeh.embed.add_document_static(elem, docs[item['docid']]);
    } else {
       Bokeh.embed.add_document_from_session(elem, item['sessionid']);
    }
  }
}<commit_msg>Log errors from doc_js.js async operations (we were ignoring the returned promises)<commit_after>Bokeh.Collections.register_models({
  {% for name, impl in custom_models.items() -%}
    "{{ name }}": {{ impl }},
  {%- endfor %}
});
var docs_json = {{ docs_json }};
var docs = {};
for (key in docs_json) {
  docs[key] = Bokeh.Document.from_json(docs_json[key]);
}
var render_items = {{ render_items }};
for (idx in render_items) {
  var item = render_items[idx];
  var elem = Bokeh.$('#' + item['elementid']);
  var promise = null;
  if ('modelid' in item && item['modelid'] !== null) {
    if ('docid' in item && item['docid'] !== null) {
      Bokeh.embed.add_model_static(elem, item['modelid'], docs[item['docid']]);
    } else {
      promise = Bokeh.embed.add_model_from_session(elem, item['modelid'], item['sessionid']);
    }
  } else {
    if ('docid' in item && item['docid'] !== null) {
       Bokeh.embed.add_document_static(elem, docs[item['docid']]);
    } else {
       promise = Bokeh.embed.add_document_from_session(elem, item['sessionid']);
    }
  }
  if (promise !== null) {
    promise.then(function(value) {}, function(error) {
      console.log("Error rendering Bokeh items ", error);
    });
  }
}
{'fraction_non_alphanumeric': 0.19310344827586207, 'fraction_numerical': 0.0, 'mean_word_length': 3.8789237668161434, 'pattern_counts': {'":': 2, '<': 3, '<?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': '1044263', 'n_tokens_mistral': 784, 'n_tokens_neox': 764, 'n_words': 156}