<commit_before>﻿using System;
using System.Collections.Generic;

namespace Microsoft.Xunit.Performance
{
    public abstract class ProviderInfo
    {
        internal ProviderInfo() { } // Only allow subclassing from this assembly

        public ulong Keywords { get; set; } = unchecked((ulong)-1);

        public static IEnumerable<ProviderInfo> Merge(IEnumerable<ProviderInfo> info)
        {
            Dictionary<Guid, UserProviderInfo> userInfo = new Dictionary<Guid, UserProviderInfo>();
            KernelProviderInfo kernelInfo = new KernelProviderInfo();

            foreach (var i in info)
                i.MergeInto(userInfo, kernelInfo);

            foreach (var i in userInfo.Values)
                yield return i;

            if (kernelInfo.Keywords != 0)
                yield return kernelInfo;
        }

        protected abstract void MergeInto(Dictionary<Guid, UserProviderInfo> userInfo, KernelProviderInfo kernelInfo);
    }
}<commit_msg>ProviderInfo needs to be serializable.<commit_after>﻿using System;
using System.Collections.Generic;

namespace Microsoft.Xunit.Performance
{
    [Serializable]
    public abstract class ProviderInfo
    {
        internal ProviderInfo() { } // Only allow subclassing from this assembly

        public ulong Keywords { get; set; } = unchecked((ulong)-1);

        public static IEnumerable<ProviderInfo> Merge(IEnumerable<ProviderInfo> info)
        {
            Dictionary<Guid, UserProviderInfo> userInfo = new Dictionary<Guid, UserProviderInfo>();
            KernelProviderInfo kernelInfo = new KernelProviderInfo();

            foreach (var i in info)
                i.MergeInto(userInfo, kernelInfo);

            foreach (var i in userInfo.Values)
                yield return i;

            if (kernelInfo.Keywords != 0)
                yield return kernelInfo;
        }

        protected abstract void MergeInto(Dictionary<Guid, UserProviderInfo> userInfo, KernelProviderInfo kernelInfo);
    }
}
{'fraction_non_alphanumeric': 0.07929292929292929, 'fraction_numerical': 0.00202020202020202, 'mean_word_length': 2.634862385321101, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1451399', 'n_tokens_mistral': 509, 'n_tokens_neox': 477, 'n_words': 141}