<commit_before>﻿// Copyright (c) <NAME>. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Test.Controls
{
    public partial class StyleControl : UserControl
    {
        public StyleControl()
        {
            InitializeComponent();
        }
    }
}<commit_msg>Added DoubleToStringConverter class<commit_after>﻿// Copyright (c) <NAME>. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Test.Controls
{
    public class DoubleToStringConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            try
            {
                double[] a = value as double[];
                if (a != null)
                    return string.Join(" ", a.Select(x => x.ToString(culture)));
            }
            catch { }

            return null;
        }
        
        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            try
            {
                string s = value as string;
                if (s != null)
                {
                    string[] a = s.Split(new char [] { ' ' });
                    if (a != null && a.Length > 0)
                        return a.Select(x => double.Parse(x, culture)).ToArray();
                }
            }
            catch { }

            return null;
        }
    }
    
    public partial class StyleControl : UserControl
    {
        public StyleControl()
        {
            InitializeComponent();
        }
    }
}
{'fraction_non_alphanumeric': 0.09228321400159109, 'fraction_numerical': 0.0003977724741447892, 'mean_word_length': 2.1875792141951838, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '3932469', 'n_tokens_mistral': 635, 'n_tokens_neox': 624, 'n_words': 189}