<commit_before>function customcontrols(entity, options) {
  var thevideo = entity;

  var options = options || {}; // if options were passed, use those; otherwise, make empty so tests don't throw errors

  var controls_div = options.controls_div ? document.getElementById(options.controls_div) : document.getElementById("custom_controls");
  var fs_div = options.fullscreen_container ? document.getElementById(options.fullscreen_container) : null;
  var control_style = options.control_style ? options.control_style : null;
  var embed_div = options.embed_container ? document.getElementById(options.embed_container) : null;
  var controlsArray = ["play_pause"]; //running list of which buttons/controls the plugin should generate
  var scalingElements = [];
  var embedFactor = 1;
  var videoRatio;



  if(fs_div){ //required for fullscreen functionality

    if(window.screenfull && window.screenfull.enabled) { //screenfull.js is a dependency. Test for presence of screenfull variable.
      options.screenfull = window.screenfull;

      // gather all immediate children of our user-supplied fullscreen div
      elementsToScale = Array.prototype.slice.call(fs_div.childNodes);
      elementsToScale.push(fs_div);

      //incorrect dependency here - shouldn't need fullscreen to calculate default embed code
      var fs_CSS = fs_div.currentStyle || getComputedStyle(fs_div,null);

      videoRatio = [stripPx(fs_CSS.width), stripPx(fs_CSS.height)];


      if(window != window.parent){

          embedFactor = window.innerWidth / stripPx(fs_CSS.width);
          
          //once we've determined what it should be, we have to adjust the
          //fs_div to match it

          fs_div.style.width = window.innerWidth+"px";
          fs_div.style.height = window.innerHeight+"px";

      }



      //for each child node, we need to keep track of: a) the element, b) original width and c) original height
      for (i=0; i<elementsToScale.length; i++){

        if(elementsToScale[i].nodeName != "#text"){
          elemCSS = elementsToScale[i].currentStyle || getComputedStyle(elementsToScale[i],null);

          //fullscreen means appropriately scaling non-video; here, calculate transform and create new style on the document
          
          /*
          * implicit here is that the fullscreen div & the video will have the same proportions
          */

          if(elementsToScale[i] === fs_div){

            // create transform class to apply to non-video elements
            var scale_style = document.createElement('style');
            scale_style.type = 'text/css';<commit_msg>Added a check to ignore comment elements when looking generating scaling information. Previously fatal error.<commit_after>function customcontrols(entity, options) {
  var thevideo = entity;

  var options = options || {}; // if options were passed, use those; otherwise, make empty so tests don't throw errors

  var controls_div = options.controls_div ? document.getElementById(options.controls_div) : document.getElementById("custom_controls");
  var fs_div = options.fullscreen_container ? document.getElementById(options.fullscreen_container) : null;
  var control_style = options.control_style ? options.control_style : null;
  var embed_div = options.embed_container ? document.getElementById(options.embed_container) : null;
  var controlsArray = ["play_pause"]; //running list of which buttons/controls the plugin should generate
  var scalingElements = [];
  var embedFactor = 1;
  var videoRatio;



  if(fs_div){ //required for fullscreen functionality

    if(window.screenfull && window.screenfull.enabled) { //screenfull.js is a dependency. Test for presence of screenfull variable.
      options.screenfull = window.screenfull;

      // gather all immediate children of our user-supplied fullscreen div
      elementsToScale = Array.prototype.slice.call(fs_div.childNodes);
      elementsToScale.push(fs_div);

      //incorrect dependency here - shouldn't need fullscreen to calculate default embed code
      var fs_CSS = fs_div.currentStyle || getComputedStyle(fs_div,null);

      videoRatio = [stripPx(fs_CSS.width), stripPx(fs_CSS.height)];


      if(window != window.parent){

          embedFactor = window.innerWidth / stripPx(fs_CSS.width);
          
          //once we've determined what it should be, we have to adjust the
          //fs_div to match it

          fs_div.style.width = window.innerWidth+"px";
          fs_div.style.height = window.innerHeight+"px";

      }



      //for each child node, we need to keep track of: a) the element, b) original width and c) original height
      for (i=0; i<elementsToScale.length; i++){

        //make sure that we're not trying to scale the text or comment nodes that may be inside the fullscreen div
        if(elementsToScale[i].nodeName != "#text" && elementsToScale[i].nodeName != "#comment"){
          elemCSS = elementsToScale[i].currentStyle || getComputedStyle(elementsToScale[i],null);

          //fullscreen means appropriately scaling non-video; here, calculate transform and create new style on the document
          
          /*
          * implicit here is that the fullscreen div & the video will have the same proportions
          */

          if(elementsToScale[i] === fs_div){

            // create transform class to apply to non-video elements
            var scale_style = document.createElement('style');
            scale_style.type = 'text/css';
{'fraction_non_alphanumeric': 0.09308705193855157, 'fraction_numerical': 0.000731528895391368, 'mean_word_length': 3.24611801242236, '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': '5369460', 'n_tokens_mistral': 1456, 'n_tokens_neox': 1395, 'n_words': 453}