<commit_before><?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" indent="yes" />

	<!--The file to fetch the limits from-->
	<xsl:param name="limits-file">dependencies/timing-limits.xml</xsl:param>
	<xsl:param name="limits" select="document($limits-file,/)"/>

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

	<xsl:template name="results" match="timingSession">
		<xsl:variable name="url" select="pageData/entry[key='url']/value"/>
		<!-- Replacing all . with _ for better junit results -->
		<xsl:variable name="junit-url">
            <xsl:call-template name="string-replace-all">
                <xsl:with-param name="text" select="$url"/>
                <xsl:with-param name="replace">.</xsl:with-param>
                <xsl:with-param name="by" select="'_'"/>
            </xsl:call-template>
        </xsl:variable>

		<testsuite name="sitespeed&#46;io.timings.{$junit-url}" >
		<xsl:apply-templates/>
		</testsuite>
	</xsl:template>

	<xsl:template name="stats" match="statistics/statistic">
		<xsl:variable name="name" select="name" />
		<xsl:variable name="limit-type" select="$limits/limits/@type"/>	
	
		<xsl:variable name="time" select="*[name(.)=$limit-type]" />
		<xsl:variable name="time-in-seconds" select="$time div 1000"/>
		<xsl:variable name="url" select="../../pageData/entry[key='url']/value" />
		<xsl:variable name="browser" select="../../pageData/entry[key='browserName']/value"/>
		<xsl:variable name="version" select="../../pageData/entry[key='browserVersion']/value"/>
		<xsl:variable name="tries" select="count(../../runs/run)"/>

		<!-- First check if we have specific values configured for  that URL else use the default ones -->
		<xsl:variable name="exist" select="boolean($limits/limits/urls/page[url=$url])"/>

		<xsl:choose>
		        <xsl:when test="$exist">
					<xsl:for-each select="$limits/limits/urls/page[url=$url]/limits/*">
				
						<xsl:if test="name(.)=$name">
						<xsl:variable name="time-limit" select="."/>
<commit_msg>cleanup<commit_after><?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" indent="yes" />

	<!--The file to fetch the limits from-->
	<xsl:param name="limits-file"/>
	<xsl:param name="limits" select="document($limits-file,/)"/>

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

	<xsl:template name="results" match="timingSession">
		<xsl:variable name="url" select="pageData/entry[key='url']/value"/>
		<!-- Replacing all . with _ for better junit results -->
		<xsl:variable name="junit-url">
            <xsl:call-template name="string-replace-all">
                <xsl:with-param name="text" select="$url"/>
                <xsl:with-param name="replace">.</xsl:with-param>
                <xsl:with-param name="by" select="'_'"/>
            </xsl:call-template>
        </xsl:variable>

		<testsuite name="sitespeed&#46;io.timings.{$junit-url}" >
		<xsl:apply-templates/>
		</testsuite>
	</xsl:template>

	<xsl:template name="stats" match="statistics/statistic">
		<xsl:variable name="name" select="name" />
		<xsl:variable name="limit-type" select="$limits/limits/@type"/>	
	
		<xsl:variable name="time" select="*[name(.)=$limit-type]" />
		<xsl:variable name="time-in-seconds" select="$time div 1000"/>
		<xsl:variable name="url" select="../../pageData/entry[key='url']/value" />
		<xsl:variable name="browser" select="../../pageData/entry[key='browserName']/value"/>
		<xsl:variable name="version" select="../../pageData/entry[key='browserVersion']/value"/>
		<xsl:variable name="tries" select="count(../../runs/run)"/>

		<!-- First check if we have specific values configured for that URL else use the default ones -->
		<xsl:variable name="exist" select="boolean($limits/limits/urls/page[url=$url])"/>

		<xsl:choose>
		        <xsl:when test="$exist">
					<xsl:for-each select="$limits/limits/urls/page[url=$url]/limits/*">
				
						<xsl:if test="name(.)=$name">
						<xsl:variable name="time-limit" select="."/>

{'fraction_non_alphanumeric': 0.21553765987683562, 'fraction_numerical': 0.009474182851729039, 'mean_word_length': 3.974087161366313, 'pattern_counts': {'":': 0, '<': 88, '<?xml version=': 2, '>': 88, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 7}, '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': '3195626', 'n_tokens_mistral': 1559, 'n_tokens_neox': 1356, 'n_words': 234}