<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
namespace With.Linq
{
    public static class ToDictionaryExtensions
    {
        public static IDictionary<TKey, TValue> ToDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> self)
        {
            return self.ToDictionary(kv => kv.Key, kv => kv.Value);
        }
        public static IDictionary<TKey, TValue> ToDictionary<TKey, TValue>(this IEnumerable<Tuple<TKey, TValue>> self)
        {
            return self.ToDictionary(kv => kv.Item1, kv => kv.Item2);
        }
        public static IDictionary<T, T> ToDictionary<T>(this IEnumerable<T[]> self)
        {
            return self.ToDictionary(kv => Get(kv, 0), kv => Get(kv, 1));
        }
        private static T Get<T>(T[] val, int position)
        {
            if (val.Length <= position)
            {
                throw new WrongArrayLengthException(val.Length, position - 1);
            }
            return val[position];
        }
    }
}
<commit_msg>Lookup extensions: fixes #22<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
namespace With.Linq
{
    public static class ToDictionaryExtensions
    {
        public static IDictionary<TKey, TValue> ToDictionary<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> self)
        {
            return self.ToDictionary(kv => kv.Key, kv => kv.Value);
        }
        public static IDictionary<TKey, TValue> ToDictionary<TKey, TValue>(this IEnumerable<Tuple<TKey, TValue>> self)
        {
            return self.ToDictionary(kv => kv.Item1, kv => kv.Item2);
        }
        public static IDictionary<T, T> ToDictionary<T>(this IEnumerable<T[]> self)
        {
            return self.ToDictionary(kv => Get(kv, 0), kv => Get(kv, 1));
        }
        private static T Get<T>(T[] val, int position)
        {
            if (val.Length <= position)
            {
                throw new WrongArrayLengthException(val.Length, position - 1);
            }
            return val[position];
        }
        public static ILookup<TKey, TValue> ToLookup<TKey, TValue>(this IEnumerable<KeyValuePair<TKey, TValue>> self)
        {
            return self.ToLookup(kv => kv.Key, kv => kv.Value);
        }
        public static ILookup<TKey, TValue> ToLookup<TKey, TValue>(this IEnumerable<Tuple<TKey, TValue>> self)
        {
            return self.ToLookup(kv => kv.Item1, kv => kv.Item2);
        }
    }
}

{'fraction_non_alphanumeric': 0.11835748792270531, 'fraction_numerical': 0.005636070853462158, 'mean_word_length': 2.322192513368984, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 51, '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': '3091975', 'n_tokens_mistral': 736, 'n_tokens_neox': 729, 'n_words': 173}