<commit_before><?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <!-- Magic sauce copied from a manual. This fragment basically
    copies everything except for stuff that explicitly matches with
    the templates defined below. In the case of such a match, the
    matched node is treated differently.-->
  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>
  <!-- End of magic sauce -->

  <!-- Read in the value of the argument. -->
  <xsl:variable name="max-node-kbps" select="//RSpec//target-context/argument[name='max-node-kbps']/value"/>

  <!-- Modify NodeSpec for which kbps > max-link-kbps -->
  <xsl:template match="NodeSpec/max_rate">
      <xsl:choose>
          <xsl:when test=". &gt; $max-node-kbps">
              <max_rate><xsl:value-of select="$max-node-kbps"/></max_rate>
          </xsl:when>
          <xsl:otherwise>
              <xsl:copy-of select="."/>
          </xsl:otherwise>
      </xsl:choose>
  </xsl:template>
      
  <!-- Fill in missing kbps values --> 
  <xsl:template match="NodeSpec[not(max_rate)]">
      <xsl:copy>
          <xsl:copy-of select="*"/>
          <max_rate><xsl:value-of select="$max-node-kbps"/></max_rate>
      </xsl:copy>
  </xsl:template>
  
  <xsl:template match="sfatables-input"/>
</xsl:stylesheet><commit_msg>Bug fix that was dropping the nodespec's attributes.<commit_after><?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <!-- Magic sauce copied from a manual. This fragment basically
    copies everything except for stuff that explicitly matches with
    the templates defined below. In the case of such a match, the
    matched node is treated differently.-->
  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>
  <!-- End of magic sauce -->

  <!-- Read in the value of the argument. -->
  <xsl:variable name="max-node-kbps" select="//RSpec//target-context/argument[name='max-node-kbps']/value"/>

  <!-- Modify NodeSpec for which kbps > max-link-kbps -->
  <xsl:template match="NodeSpec/max_rate">
      <xsl:choose>
          <xsl:when test=". &gt; $max-node-kbps">
              <max_rate><xsl:value-of select="$max-node-kbps"/></max_rate>
          </xsl:when>
          <xsl:otherwise>
              <xsl:copy-of select="."/>
          </xsl:otherwise>
      </xsl:choose>
  </xsl:template>
      
  <!-- Fill in missing kbps values --> 
  <xsl:template match="NodeSpec[not(max_rate)]">
      <xsl:copy>
          <xsl:copy-of select="."/>
          <max_rate><xsl:value-of select="$max-node-kbps"/></max_rate>
      </xsl:copy>
  </xsl:template>
  
  <xsl:template match="sfatables-input"/>
</xsl:stylesheet>
{'fraction_non_alphanumeric': 0.18175559380378659, 'fraction_numerical': 0.00963855421686747, 'mean_word_length': 2.854111405835544, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 2, '>': 75, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, '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': '3384548', 'n_tokens_mistral': 1013, 'n_tokens_neox': 920, 'n_words': 212}