<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Stylet
{
    public class LabelledValue<T> : IEquatable<LabelledValue<T>>
    {
        public string Label { get; set; }
        public T Value { get; set; }

        public LabelledValue(string label, T value)
        {
            this.Label = label;
            this.Value = value;
        }

        public bool Equals(LabelledValue<T> other)
        {
            return this.Label == other.Label && EqualityComparer<T>.Default.Equals(this.Value, other.Value);
        }

        public override bool Equals(object obj)
        {
            return (obj is LabelledValue<T>) ? this.Equals((LabelledValue<T>)obj) : false;
        }

        public override int GetHashCode()
        {
            return this.Label.GetHashCode() ^ this.Value.GetHashCode();
        }

        public override string ToString()
        {
            return this.Label;
        }
    }

    public static class LabelledValue
    {
        public static LabelledValue<T> Create<T>(string label, T value)
        {
            return new LabelledValue<T>(label, value);
        }
    }
}
<commit_msg>Fix LabelledValue<T>.Equals<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Stylet
{
    public class LabelledValue<T> : IEquatable<LabelledValue<T>>
    {
        public string Label { get; set; }
        public T Value { get; set; }

        public LabelledValue(string label, T value)
        {
            this.Label = label;
            this.Value = value;
        }

        public bool Equals(LabelledValue<T> other)
        {
            return other == null ? false : this.Label == other.Label && EqualityComparer<T>.Default.Equals(this.Value, other.Value);
        }

        public override bool Equals(object obj)
        {
            return this.Equals(obj as LabelledValue<T>);
        }

        public override int GetHashCode()
        {
            return this.Label.GetHashCode() ^ this.Value.GetHashCode();
        }

        public override string ToString()
        {
            return this.Label;
        }
    }

    public static class LabelledValue
    {
        public static LabelledValue<T> Create<T>(string label, T value)
        {
            return new LabelledValue<T>(label, value);
        }
    }
}

{'fraction_non_alphanumeric': 0.09886086248982913, 'fraction_numerical': 0.0, 'mean_word_length': 1.995127892813642, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 23, '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': '3478507', 'n_tokens_mistral': 701, 'n_tokens_neox': 685, 'n_words': 168}