<commit_before>(function()
{
  var rsplit, chop, extend;
  
  EJS = function( options )
  {
    this.construct.apply(this, arguments);
  };

  /* @Prototype*/
  EJS.prototype =
  {
    render : function(object, return_canvas)
    {
      var obj = this.template.process(object);
      obj.name = this.name;
      var ret = obj._EJS_EXECUTE_FUNC.call(obj.across);

      function RandomNumb()
      {
        var ret = "EJS_ANCOR_";

        for (var i = 0; i < 10; i++)
          ret += '0' + Math.floor(Math.random() * 10);

        return ret;
      }

      var ancor_id = RandomNumb();
      var ancor =  "<div id=\"" + ancor_id + "\" class='ejs_ancor'></div>";

      var hook = obj.hook_first;

      obj.across.first = function()
      {
        if (typeof(obj.first) != 'undefined')
          return hook(obj.first);

        var ancor = document.getElementById(ancor_id);
        if (ancor == null)
          return null;
        var elem = ancor;
        do
        {
          elem = elem.nextSibling;
        } while (elem && elem.nodeType !== 1);
        
        obj.first = elem;
        ancor.parentNode.removeChild(ancor);
        return this.first();
      };

      obj.across.Defer(function()
      {
        this.first(true);
      });

      obj.RenderCompleted.call(obj, ancor_id);

      obj.html = ancor + ret;
      if (return_canvas)
        return obj;
      return obj.html;
    }
    ,
    update : function(element, options)
    {
      if(typeof element == 'string')
        element = document.getElementById(element);

      if(options == null)
      {
        _template = this;
        return function(object)
        {
          EJS.prototype.update.call(_template, element, object);
        }<commit_msg>Two step rendering. Allow change object before execution<commit_after>(function()
{
  var rsplit, chop, extend;
  
  EJS = function( options )
  {
    this.construct.apply(this, arguments);
  };

  /* @Prototype*/
  EJS.prototype =
  {
    prepare : function(object, return_canvas)
    {
      var obj = this.template.process(object);
      obj.name = this.name;

      obj.across.Defer(function()
      {
        this.first(true);
      });
      return obj;
    }
    ,
    execute : function(obj)
    {
      var ret = obj._EJS_EXECUTE_FUNC.call(obj.across);
      obj.RenderCompleted.call(obj, ancor_id);

      function RandomNumb()
      {
        var ret = "EJS_ANCOR_";

        for (var i = 0; i < 10; i++)
          ret += '0' + Math.floor(Math.random() * 10);

        return ret;
      }

      var ancor_id = RandomNumb();
      var ancor =  "<div id=\"" + ancor_id + "\" class='ejs_ancor'></div>";

      var hook = obj.hook_first;

      obj.across.first = function()
      {
        if (typeof(obj.first) != 'undefined')
          return hook(obj.first);

        var ancor = document.getElementById(ancor_id);
        if (ancor == null)
          return null;
        var elem = ancor;
        do
        {
          elem = elem.nextSibling;
        } while (elem && elem.nodeType !== 1);
        
        obj.first = elem;
        ancor.parentNode.removeChild(ancor);
        return this.first();
      };

      obj.html = ancor + ret;
      return ret;
    }
    ,
    render : function(object, return_canvas)
    {
      var obj = this.prepare(object);
      this.execute(obj);

      if (return_canvas)
        return obj;
      return obj.html;
    }
    ,
    update : function(element, options)
    {
      if(typeof element == 'string')
        element = document.getElementById(element);

      if(options == null)
      {
        _template = this;
        return function(object)
        {
          EJS.prototype.update.call(_template, element, object);
        }
{'fraction_non_alphanumeric': 0.13210075026795284, 'fraction_numerical': 0.0037513397642015005, 'mean_word_length': 1.825889477668433, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '2284123', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1168, 'n_words': 246}