<commit_before><?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:output method="xml" indent="yes"/>
  <xsl:strip-space elements="*"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="*">
    <xsl:copy>
      <!-- Sort the attributes by name and remove the xml:base attribute -->
      <xsl:for-each select="@*[name()!='xml:base']">
        <xsl:sort select="name( . )"/>
        <xsl:attribute name="{local-name()}"><xsl:value-of select="normalize-space(.)"/></xsl:attribute>
      </xsl:for-each>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>
<commit_msg>xml: Slight change in VPR XML format.<commit_after><?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:output method="xml" indent="yes"/>
  <xsl:strip-space elements="*"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="*">
    <xsl:copy>
      <!-- Sort the attributes by name and remove the xml:base attribute -->
      <xsl:for-each select="@*[name()!='xml:base']">
	<xsl:sort select="name( . )"/>
	<xsl:attribute name="{local-name()}"><xsl:value-of select="normalize-space(.)"/></xsl:attribute>
      </xsl:for-each>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>

  <!-- Allow from attribute which gives you a relative to a given pb_type -->
  <xsl:template name="from-pb_type">
    <xsl:choose>
      <xsl:when test="@from='current'"><xsl:value-of select="ancestor::pb_type[1]/@name"/></xsl:when>
      <xsl:when test="@from"><xsl:value-of select="@from"/></xsl:when>
      <xsl:otherwise><xsl:value-of select="ancestor::pb_type[1]/@name"/></xsl:otherwise>
    </xsl:choose>
  </xsl:template>

  <!--
    Convert
     * <port name=XXX> 				to XXX
     * <port name=XXX bit=Y> 			to XXX[Y]
     * <port name=XXX bit_msb=M bit_lsb=L>	to XXX[M:L]
    -->
  <xsl:template name="port-value"><xsl:value-of select="@name"/><xsl:choose><xsl:when test="@bit">[<xsl:value-of select="@bit"/>]</xsl:when><xsl:when test="@bit-msb">[<xsl:value-of select="@bit-msb"/>:<xsl:value-of select="@bit-lsb"/>]</xsl:when><xsl:otherwise></xsl:otherwise></xsl:choose></xsl:template>

  <!--
    Convert
      <interconnect><XXX><port type='input' ...><port type='output' ...></XXX><YYY../></interconnect>
    to
      <interconnect><XXX input='...' output='...'><YYY../></XXX></interconnect>
    -->
  <xsl:template match="interconnect/*/port[@type='input']">
    <xsl:attribute name="input"><xsl:call-template name="from-pb_type"/>.<xsl:call-template name="port-value"/></xsl:attribute>
  </xsl:template>
  <xsl:template match="interconnect/*/port[@type='output']">
    <xsl:attribute name="name"><xsl:call-template name="from-pb_type"/>-<xsl:call-template name="port-value"/></xsl:attribute>
    <xsl:attribute name="output"><xsl:call-template name="from-pb_type"/>.<xsl:call-template name="port-value"/></xsl:attribute>
  </xsl:template>
  <!--
    Convert
      <loc ...><port ...><port ...></loc>
    to
      <loc ...>BLOCK.PORT BLOCK.PORT</loc>
    -->
  <xsl:template match="loc/port"><xsl:text>
      </xsl:text><xsl:call-template name="from-pb_type"/>.<xsl:call-template name="port-value"/>
  </xsl:template>
  <xsl:template match="loc/port[last()]"><xsl:text>
      </xsl:text><xsl:call-template name="from-pb_type"/>.<xsl:call-template name="port-value"/><xsl:text>
    </xsl:text>
  </xsl:template>

{'fraction_non_alphanumeric': 0.23906205318844723, 'fraction_numerical': 0.005719187875321705, 'mean_word_length': 4.0476190476190474, 'pattern_counts': {'":': 0, '<': 123, '<?xml version=': 2, '>': 123, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 11}, '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': '3541936', 'n_tokens_mistral': 1344, 'n_tokens_neox': 1207, 'n_words': 181}