<commit_before><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:exsl="http://exslt.org/common"
                extension-element-prefixes="exsl"
                version="1.0">

    <xsl:output omit-xml-declaration="no" indent="yes" />

    <xsl:strip-space elements="*"/>

    <xsl:template match="node()|@*">
        <xsl:copy>
            <xsl:apply-templates select="node()|@*"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template name="convert-known-meta-element">
        <xsl:param name="prefix"/>
        <xsl:param name="asValue"/>
        <xsl:variable name="prefix-length" select="string-length($prefix)+1"/>
        <xsl:variable name="currNodeName" select="local-name(.)"/>
        <xsl:variable name="suffix" select="substring($currNodeName,$prefix-length)"/>
        <xsl:if test="starts-with($currNodeName, $prefix) and (string-length($suffix) >0)">
            <xsl:element name="meta">
                <xsl:attribute name="name">
                    <xsl:value-of select="$suffix"/>
                </xsl:attribute>
                <xsl:attribute name="ml_handling">unique</xsl:attribute>
                <xsl:choose>
                    <xsl:when test="$asValue">
                        <xsl:element name="value">
                            <xsl:attribute name="lang">eng</xsl:attribute>
                            <xsl:value-of select="."/>
                        </xsl:element>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="."/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:element>
        </xsl:if>
    </xsl:template>


    <xsl:template name="create-ott-tags">
        <xsl:param name="metadatas"/>
        <xsl:variable name="prefix" select="'OTTTAG'"/>
        <!--list here should include a list like this -->
        <!--<OTTTAGActor>A</OTTTAGActor>-->
        <!--<OTTTAGActor>B</OTTTAGActor>-->
        <xsl:variable name="OTTTagsWithAttributes">
            <xsl:for-each select="$metadatas">
                <xsl:variable name="prefix-length" select="string-length($prefix)+1"/>
                <xsl:variable name="currNodeName" select="local-name(.)"/>
                <xsl:variable name="suffix" select="substring($currNodeName,$prefix-length)"/>
                <xsl:if test="starts-with($currNodeName, $prefix)  and (string-length($suffix) >0)">
                    <xsl:element name="otttag">
                        <xsl:attribute name="name">
                            <xsl:value-of select="$suffix"/>
                        </xsl:attribute>
                        <xsl:value-of select="."/>
                    </xsl:element>
                </xsl:if>
            </xsl:for-each>
        </xsl:variable>
        <xsl:variable name="tagsWithAttributes" select="exsl:node-set($OTTTagsWithAttributes)/*"/>
        <!--at this point the OTTTagsWithAttributes should be as follow:-->
        <!--<meta name="Actor" value="A"/>-->
        <!--<meta name="Actor" value="B"/>-->
        <xsl:variable name="OTTTagUniques">
            <xsl:for-each select="exsl:node-set($tagsWithAttributes)">
                <xsl:if test="not(./@name = preceding-sibling::otttag/@name)"><commit_msg>PLAT-3438 change underscore to spaces MediaPrep PLAT-3438 change underscore to spaces MediaPrep for custom fields<commit_after><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:exsl="http://exslt.org/common"
                extension-element-prefixes="exsl"
                version="1.0">

    <xsl:output omit-xml-declaration="no" indent="yes" />

    <xsl:strip-space elements="*"/>

    <xsl:template match="node()|@*">
        <xsl:copy>
            <xsl:apply-templates select="node()|@*"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template name="convert-known-meta-element">
        <xsl:param name="prefix"/>
        <xsl:param name="asValue"/>
        <xsl:variable name="prefix-length" select="string-length($prefix)+1"/>
        <xsl:variable name="currNodeName" select="local-name(.)"/>
        <xsl:variable name="suffix" select="substring($currNodeName,$prefix-length)"/>
        <xsl:variable name="normalized-suffix" select="normalize-space(translate($suffix,'_',' '))"/>
        <xsl:if test="starts-with($currNodeName, $prefix) and (string-length($suffix) >0)">
            <xsl:element name="meta">
                <xsl:attribute name="name">
                    <xsl:value-of select="$normalized-suffix"/>
                </xsl:attribute>
                <xsl:attribute name="ml_handling">unique</xsl:attribute>
                <xsl:choose>
                    <xsl:when test="$asValue">
                        <xsl:element name="value">
                            <xsl:attribute name="lang">eng</xsl:attribute>
                            <xsl:value-of select="."/>
                        </xsl:element>
                    </xsl:when>
                    <xsl:otherwise>
                        <xsl:value-of select="."/>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:element>
        </xsl:if>
    </xsl:template>


    <xsl:template name="create-ott-tags">
        <xsl:param name="metadatas"/>
        <xsl:variable name="prefix" select="'OTTTAG'"/>
        <!--list here should include a list like this -->
        <!--<OTTTAGActor>A</OTTTAGActor>-->
        <!--<OTTTAGActor>B</OTTTAGActor>-->
        <xsl:variable name="OTTTagsWithAttributes">
            <xsl:for-each select="$metadatas">
                <xsl:variable name="prefix-length" select="string-length($prefix)+1"/>
                <xsl:variable name="currNodeName" select="local-name(.)"/>
                <xsl:variable name="suffix" select="substring($currNodeName,$prefix-length)"/>
                <xsl:variable name="normalized-suffix" select="normalize-space(translate($suffix,'_',' '))"/>
                <xsl:if test="starts-with($currNodeName, $prefix)  and (string-length($suffix) >0)">
                    <xsl:element name="otttag">
                        <xsl:attribute name="name">
                            <xsl:value-of select="$normalized-suffix"/>
                        </xsl:attribute>
                        <xsl:value-of select="."/>
                    </xsl:element>
                </xsl:if>
            </xsl:for-each>
        </xsl:variable>
        <xsl:variable name="tagsWithAttributes" select="exsl:node-set($OTTTagsWithAttributes)/*"/>
        <!--at this point the OTTTagsWithAttributes should be as follow:-->
        <!--<meta name="Actor" value="A"/>-->
        <!--<meta name="Actor" value="B"/>-->
        <xsl:variable name="OTTTagUniques">
            <xsl:for-each select="exsl:node-set($tagsWithAttributes)">
                <xsl:if test="not(./@name = preceding-sibling::otttag/@name)">
{'fraction_non_alphanumeric': 0.17271407837445574, 'fraction_numerical': 0.0043541364296081275, 'mean_word_length': 1.979247730220493, 'pattern_counts': {'":': 0, '<': 145, '<?xml version=': 0, '>': 149, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, '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': '6722399', 'n_tokens_mistral': 2139, 'n_tokens_neox': 1894, 'n_words': 299}