<commit_before>using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Reflection;

namespace WebNoodle.Reflection
{
    public static class ImplicitConversionMethodHelper
    {
        
        public static MethodInfo ImplicitConversionMethod(Type from, Type to)
        {
            return UncachedGetImplicitConversionMethod(from, to);
        }

        public static MethodInfo UncachedGetImplicitConversionMethod(Type from, Type to)
        {
            return to.GetMethods(BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Static)<commit_msg>Cached results for perf<commit_after>using System;
using System.Collections.Concurrent;
using System.Linq;
using System.Reflection;

namespace WebNoodle.Reflection
{
    public static class ImplicitConversionMethodHelper
    {
        static ConcurrentDictionary<Type, ConcurrentDictionary<Type, MethodInfo>> cache = new
            ConcurrentDictionary<Type, ConcurrentDictionary<Type, MethodInfo>>();
        public static MethodInfo ImplicitConversionMethod(Type from, Type to)
        {
            var inner = cache.GetOrAdd(to, (t) => new ConcurrentDictionary<Type, MethodInfo>());
            return inner.GetOrAdd(from, t => UncachedGetImplicitConversionMethod(from, to));
        }


        public static MethodInfo UncachedGetImplicitConversionMethod(Type from, Type to)
        {
            return to.GetMethods(BindingFlags.Public | BindingFlags.DeclaredOnly | BindingFlags.Static)
{'fraction_non_alphanumeric': 0.07190860215053764, 'fraction_numerical': 0.0, 'mean_word_length': 3.6823899371069184, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 10, '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': '3745417', 'n_tokens_mistral': 383, 'n_tokens_neox': 376, 'n_words': 90}