<commit_before><xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:xalan="http://xml.apache.org/xalan"
   xmlns:vpre="vpre"
   extension-element-prefixes="vpre"
   >

   <xalan:component prefix="vpre" functions="identify_video_site" elements="make_vimeo_embed make_youtube_embed">
      <xalan:script lang="javascript">
         function identify_video_site(url){
            
         }

         function vimeo_id(url){
         }

         function youtube_id(url){
            var re = /.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#\&\?]*).*/;
            return url.match(re)[1];
         }
      </xalan:script>
   </xalan:component>

</xsl:stylesheet>

<commit_msg>Filled out JS function for identifying video site<commit_after><xsl:stylesheet version="1.0"
   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:xalan="http://xml.apache.org/xalan"
   xmlns:vpre="vpre"
   extension-element-prefixes="vpre"
   >

   <xalan:component prefix="vpre" functions="identify_video_site" elements="make_vimeo_embed make_youtube_embed">
      <xalan:script lang="javascript">
         function identify_video_site(url){
            var re = /(youtu\.?be|vimeo)/i;
            var match = url.match(re);
            if( !match ){ return "unsupported"; }
            else { match = match[1]; }
            if( match == "youtube" || match == "youtu.be" ){ return "youtube"; }
            else { return "vimeo"; }
         }

         function vimeo_id(url){
         }

         function youtube_id(url){
            var re = /.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#\&\?]*).*/;
            return url.match(re)[1];
         }
      </xalan:script>
   </xalan:component>

</xsl:stylesheet>


{'fraction_non_alphanumeric': 0.17994269340974212, 'fraction_numerical': 0.009742120343839542, 'mean_word_length': 2.437007874015748, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, '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': '2062485', 'n_tokens_mistral': 635, 'n_tokens_neox': 602, 'n_words': 84}