<commit_before>(function() {
var YouTubeVideo = function(domObject, url) {
  this.domObject = domObject;
  this.url = url;
};

YouTubeVideo.youTubeRegEx = new RegExp('^http://www\.youtube\.com/v/');
YouTubeVideo.canHandleURL = function(url) {
  return YouTubeVideo.youTubeRegEx.test(url);
};

YouTubeVideo.prototype.videoIDRegEx = new RegExp('/([-_A-Z0-9]+)(&|$)', 'i');

YouTubeVideo.oldSwfVarsSplitter = function(flashVarsRaw) {
  var flashVars = {};
  flashVarsRaw = flashVarsRaw.split(', ');
  for (var idx = 0; idx < flashVarsRaw.length; idx++) {
    var keyValues = flashVarsRaw[idx].split(': '),
        key = keyValues.shift(),
        val = keyValues.join(': ');
    
    if (key.charAt(0) == '"') {
      key = key.substring(1, key.length - 1);
    }
    
    if (val.charAt(0) == '"') {
      val = val.substring(1, val.length - 1);
    }
    
    flashVars[key] = val;
  }
  
  return flashVars;
};

YouTubeVideo.newFlashvarsSplitter = function(flashVarsRaw) {
  var flashVars = {};
  flashVarsRaw = flashVarsRaw.split('&');
  for (var idx = 0; idx < flashVarsRaw.length; idx++) {
    var keyValues = flashVarsRaw[idx].split('='),
        key = keyValues.shift(),
        val = keyValues.join('=');
    
    flashVars[key] = val;
  }
  
  return flashVars;
};

YouTubeVideo.prototype.swfVarsRegEx = [
  [new RegExp('<param name=\\\\"flashvars\\\\" value=\\\\"(.*?)\\\\">'), YouTubeVideo.newFlashvarsSplitter],
  [new RegExp("var swfArgs = \\{(.*?)\\}"), YouTubeVideo.oldSwfVarsSplitter],
  [new RegExp("'SWF_ARGS': \\{(.*?)\\}"), YouTubeVideo.oldSwfVarsSplitter]
];

YouTubeVideo.prototype.watchURL = function() {
  return "http://www.youtube.com/watch?v=" + this.videoID;<commit_msg>Handles both swfArgs and swfConfig.<commit_after>(function() {
var YouTubeVideo = function(domObject, url) {
  this.domObject = domObject;
  this.url = url;
};

YouTubeVideo.youTubeRegEx = new RegExp('^http://www\.youtube\.com/v/');
YouTubeVideo.canHandleURL = function(url) {
  return YouTubeVideo.youTubeRegEx.test(url);
};

YouTubeVideo.prototype.videoIDRegEx = new RegExp('/([-_A-Z0-9]+)(&|$)', 'i');

YouTubeVideo.oldSwfVarsSplitter = function(flashVarsRaw) {
  var flashVars = {};
  flashVarsRaw = flashVarsRaw.split(', ');
  for (var idx = 0; idx < flashVarsRaw.length; idx++) {
    var keyValues = flashVarsRaw[idx].split(': '),
        key = keyValues.shift(),
        val = keyValues.join(': ');
    
    if (key.charAt(0) == '"') {
      key = key.substring(1, key.length - 1);
    }
    
    if (val.charAt(0) == '"') {
      val = val.substring(1, val.length - 1);
    }
    
    flashVars[key] = val;
  }
  
  return flashVars;
};

YouTubeVideo.newFlashvarsSplitter = function(flashVarsRaw) {
  var flashVars = {};
  flashVarsRaw = flashVarsRaw.split('&');
  for (var idx = 0; idx < flashVarsRaw.length; idx++) {
    var keyValues = flashVarsRaw[idx].split('='),
        key = keyValues.shift(),
        val = keyValues.join('=');
    
    flashVars[key] = val;
  }
  
  return flashVars;
};

YouTubeVideo.prototype.swfVarsRegEx = [
  [new RegExp('<param name=\\\\"flashvars\\\\" value=\\\\"(.*?)\\\\">'), YouTubeVideo.newFlashvarsSplitter],
  [new RegExp("var swf(?:Args|Config) = \\{(.*?)\\}"), YouTubeVideo.oldSwfVarsSplitter],
  [new RegExp("'SWF_ARGS': \\{(.*?)\\}"), YouTubeVideo.oldSwfVarsSplitter]
];

YouTubeVideo.prototype.watchURL = function() {
  return "http://www.youtube.com/watch?v=" + this.videoID;
{'fraction_non_alphanumeric': 0.19795620437956205, 'fraction_numerical': 0.00583941605839416, 'mean_word_length': 3.449350649350649, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '4397354', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1258, 'n_words': 199}