<commit_before>﻿using JetBrains.Annotations;
using System.Collections.Generic;
using System.Linq;

namespace JotunShard.Extensions
{
    public static class Dictionaries
    {
        public static IDictionary<TKey, TValue> DefaultIfEmpty<TKey, TValue>(
            [NotNull] this IDictionary<TKey, TValue> source,
            TKey key = default(TKey),
            TValue value = default(TValue))
        {
            source.CheckArgumentNull(nameof(source));
            return source.Count != 0
                ? source
                : new Dictionary<TKey, TValue>(1)
                {
                    [key] = value,
                };
        }

        public static IDictionary<TKey, TValue> DefaultIfEmpty<TKey, TValue>(
            [NotNull] this IDictionary<TKey, TValue> source,
            KeyValuePair<TKey, TValue> pair = default(KeyValuePair<TKey, TValue>))
            => source.DefaultIfEmpty(pair.Key, pair.Value);

        public static bool SequenceEqual<TKey, TValue>(
            [NotNull] this IDictionary<TKey, TValue> source,
            [NotNull] IEnumerable<KeyValuePair<TKey, TValue>> other,
            IEqualityComparer<KeyValuePair<TKey, TValue>> comparer = null)
            => source.AsEnumerable().SequenceEqual(other, comparer);
    }
}<commit_msg>Removed obsolete Dictionaries.SequenceEqual<commit_after>﻿using JetBrains.Annotations;
using System.Collections.Generic;
using System.Linq;

namespace JotunShard.Extensions
{
    public static class Dictionaries
    {
        public static IDictionary<TKey, TValue> DefaultIfEmpty<TKey, TValue>(
            [NotNull] this IDictionary<TKey, TValue> source,
            TKey key = default(TKey),
            TValue value = default(TValue))
        {
            source.CheckArgumentNull(nameof(source));
            return source.Count != 0
                ? source
                : new Dictionary<TKey, TValue>(1)
                {
                    [key] = value,
                };
        }

        public static IDictionary<TKey, TValue> DefaultIfEmpty<TKey, TValue>(
            [NotNull] this IDictionary<TKey, TValue> source,
            KeyValuePair<TKey, TValue> pair = default(KeyValuePair<TKey, TValue>))
            => source.DefaultIfEmpty(pair.Key, pair.Value);

    }
}
{'fraction_non_alphanumeric': 0.0984182776801406, 'fraction_numerical': 0.0017574692442882249, 'mean_word_length': 2.2435897435897436, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 30, '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': '4869115', 'n_tokens_mistral': 645, 'n_tokens_neox': 624, 'n_words': 136}