<commit_before>using System.Text.RegularExpressions;

namespace System.IO.BACnet
{
    [Serializable]
    public struct BacnetObjectId : IComparable<BacnetObjectId>
    {
        public BacnetObjectTypes type;
        public uint instance;

        public BacnetObjectTypes Type
        {
            get { return type; }
            set { type = value; }
        }

        public uint Instance
        {
            get { return instance; }
            set { instance = value; }
        }

        public BacnetObjectId(BacnetObjectTypes type, uint instance)
        {
            this.type = type;
            this.instance = instance;
        }

        public override string ToString()
        {
            return $"{Type}:{Instance}";
        }

        public override int GetHashCode()
        {
            return ToString().GetHashCode();
        }

        public override bool Equals(object obj)
        {
            return obj != null && obj.ToString().Equals(ToString());
        }

        public int CompareTo(BacnetObjectId other)
        {
            if (Type == BacnetObjectTypes.OBJECT_DEVICE)
                return -1;

            if (other.Type == BacnetObjectTypes.OBJECT_DEVICE)
                return 1;

            return Type == other.Type
                ? Instance.CompareTo(other.Instance)
                // cast to int for comparison otherwise unpredictable behaviour with outbound enum (proprietary type)
                : ((int)Type).CompareTo((int)other.Type);
        }
<commit_msg>added equality operators to BacnetObjectId<commit_after>using System.Text.RegularExpressions;

namespace System.IO.BACnet
{
    [Serializable]
    public struct BacnetObjectId : IComparable<BacnetObjectId>
    {
        public BacnetObjectTypes type;
        public uint instance;

        public BacnetObjectTypes Type
        {
            get { return type; }
            set { type = value; }
        }

        public uint Instance
        {
            get { return instance; }
            set { instance = value; }
        }

        public BacnetObjectId(BacnetObjectTypes type, uint instance)
        {
            this.type = type;
            this.instance = instance;
        }

        public override string ToString()
        {
            return $"{Type}:{Instance}";
        }

        public override int GetHashCode()
        {
            return ToString().GetHashCode();
        }

        public override bool Equals(object obj)
        {
            return obj != null && obj.ToString().Equals(ToString());
        }

        public int CompareTo(BacnetObjectId other)
        {
            if (Type == BacnetObjectTypes.OBJECT_DEVICE)
                return -1;

            if (other.Type == BacnetObjectTypes.OBJECT_DEVICE)
                return 1;

            return Type == other.Type
                ? Instance.CompareTo(other.Instance)
                // cast to int for comparison otherwise unpredictable behaviour with outbound enum (proprietary type)
                : ((int)Type).CompareTo((int)other.Type);
        }

        public static bool operator ==(BacnetObjectId a, BacnetObjectId b)
        {
            return a.Equals(b);
        }

        public static bool operator !=(BacnetObjectId a, BacnetObjectId b)
        {
            return !(a == b);
        }

{'fraction_non_alphanumeric': 0.08400840084008401, 'fraction_numerical': 0.0012001200120012002, 'mean_word_length': 1.6251968503937009, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '316473', 'n_tokens_mistral': 886, 'n_tokens_neox': 835, 'n_words': 215}