<commit_before>using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;

namespace MonoTorrent.Common
{
    public class MonoTorrentCollection<T> : IList<T>
    {
        private List<T> list;
        private bool readOnly;

        public MonoTorrentCollection()
        {
            list = new List<T>();
        }

        public MonoTorrentCollection(IEnumerable<T> collection)
        {
            list = new List<T>(collection);
        }

        public MonoTorrentCollection(int capacity)
        {
            list = new List<T>(capacity);
        }

        public void AddRange(IEnumerable<T> collection)
        {
            list.AddRange(collection);
        }

        public MonoTorrentCollection<T> Clone()
        {
            MonoTorrentCollection<T> clone = new MonoTorrentCollection<T>(Count);
            clone.AddRange(this);
            return clone;
        }

        public T Dequeue()
        {
            T result = this[0];
            RemoveAt(0);
            return result;
        }

        public void ForEach(Action<T> action)
        {
            list.ForEach(action);
        }

        public int IndexOf(T item)
        {
            return list.IndexOf(item);
        }

        public void Insert(int index, T item)
        {
            Insert(index, item, false);
        }
        internal void Insert(int index, T item, bool ignoreReadonly)
        {
            if (!ignoreReadonly)
                CheckReadonly();
            list.Insert(index, item);
        }

        public void RemoveAt(int index)
        {
            RemoveAt(index, false);
        }

        public void RemoveAll(Predicate<T> match)
        {
            list.RemoveAll(match);
        }

        internal void RemoveAt(int index, bool ignoreReadonly)
        {
            if (!ignoreReadonly)
                CheckReadonly();
            list.RemoveAt(index);
        }
        public T this[int index]
        {
            get  { return list[index]; }
            set
            {
                this[index, false] = value;
            }
        }

        internal T this[int index, bool ignoreReadonly]
        {
            get { return list[index]; }
            set
            {
                if (!ignoreReadonly)
                    CheckReadonly();
                list[index] = value;
            }
        }

        public void Add(T item)
        {
            Add(item, false);
        }

        internal void Add(T item, bool ignoreReadonly)
        {
            if (!ignoreReadonly)
                CheckReadonly();
            list.Add(item);
        }

        public void Clear()
        {
            Clear(false);
        }

        internal void Clear(bool ignoreReadonly)
        {
            if (!ignoreReadonly)
                CheckReadonly();
            list.Clear();
        }

        public bool Contains(T item)
        {
            return list.Contains(item);
        }

        public void CopyTo(T[] array, int arrayIndex)
        {
            list.CopyTo(array, arrayIndex);
        }

        public int Count
        {
            get { return list.Count; ; }
        }

        public bool IsReadOnly
        {
            get { return readOnly; }
            internal set { readOnly = value; }
        }

        public bool Remove(T item)
        {
            return Remove(item, false);
        }

        internal bool Remove(T item, bool ignoreReadonly)
        {
            if (!ignoreReadonly)
                CheckReadonly();
            return list.Remove(item);
        }

        private void CheckReadonly()
        {
            if (readOnly)
                throw new InvalidOperationException("The operation is not allowed as the list is read only");
        }

        public IEnumerator<T> GetEnumerator()
        {
            return list.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return ((IEnumerable)list).GetEnumerator();
        }

        internal T Find(Predicate<T> match)
        {
            return list.Find(match);
        }

        internal bool Exists(Predicate<T> match)<commit_msg>Those methods should be public<commit_after>using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;

namespace MonoTorrent.Common
{
    public class MonoTorrentCollection<T> : IList<T>
    {
        private List<T> list;
        private bool readOnly;

        public MonoTorrentCollection()
        {
            list = new List<T>();
        }

        public MonoTorrentCollection(IEnumerable<T> collection)
        {
            list = new List<T>(collection);
        }

        public MonoTorrentCollection(int capacity)
        {
            list = new List<T>(capacity);
        }

        public void AddRange(IEnumerable<T> collection)
        {
            list.AddRange(collection);
        }

        public MonoTorrentCollection<T> Clone()
        {
            MonoTorrentCollection<T> clone = new MonoTorrentCollection<T>(Count);
            clone.AddRange(this);
            return clone;
        }

        public T Dequeue()
        {
            T result = this[0];
            RemoveAt(0);
            return result;
        }

        public void ForEach(Action<T> action)
        {
            list.ForEach(action);
        }

        public int IndexOf(T item)
        {
            return list.IndexOf(item);
        }

        public void Insert(int index, T item)
        {
            Insert(index, item, false);
        }
        internal void Insert(int index, T item, bool ignoreReadonly)
        {
            if (!ignoreReadonly)
                CheckReadonly();
            list.Insert(index, item);
        }

        public void RemoveAt(int index)
        {
            RemoveAt(index, false);
        }

        public void RemoveAll(Predicate<T> match)
        {
            list.RemoveAll(match);
        }

        internal void RemoveAt(int index, bool ignoreReadonly)
        {
            if (!ignoreReadonly)
                CheckReadonly();
            list.RemoveAt(index);
        }
        public T this[int index]
        {
            get  { return list[index]; }
            set
            {
                this[index, false] = value;
            }
        }

        internal T this[int index, bool ignoreReadonly]
        {
            get { return list[index]; }
            set
            {
                if (!ignoreReadonly)
                    CheckReadonly();
                list[index] = value;
            }
        }

        public void Add(T item)
        {
            Add(item, false);
        }

        internal void Add(T item, bool ignoreReadonly)
        {
            if (!ignoreReadonly)
                CheckReadonly();
            list.Add(item);
        }

        public void Clear()
        {
            Clear(false);
        }

        internal void Clear(bool ignoreReadonly)
        {
            if (!ignoreReadonly)
                CheckReadonly();
            list.Clear();
        }

        public bool Contains(T item)
        {
            return list.Contains(item);
        }

        public void CopyTo(T[] array, int arrayIndex)
        {
            list.CopyTo(array, arrayIndex);
        }

        public int Count
        {
            get { return list.Count; ; }
        }

        public bool IsReadOnly
        {
            get { return readOnly; }
            internal set { readOnly = value; }
        }

        public bool Remove(T item)
        {
            return Remove(item, false);
        }

        internal bool Remove(T item, bool ignoreReadonly)
        {
            if (!ignoreReadonly)
                CheckReadonly();
            return list.Remove(item);
        }

        private void CheckReadonly()
        {
            if (readOnly)
                throw new InvalidOperationException("The operation is not allowed as the list is read only");
        }

        public IEnumerator<T> GetEnumerator()
        {
            return list.GetEnumerator();
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return ((IEnumerable)list).GetEnumerator();
        }

        public T Find(Predicate<T> match)
        {
            return list.Find(match);
        }

        public bool Exists(Predicate<T> match)
{'fraction_non_alphanumeric': 0.08645944980350125, 'fraction_numerical': 0.00047636060497796833, 'mean_word_length': 1.3027145599122567, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '7149938', 'n_tokens_mistral': 2192, 'n_tokens_neox': 2125, 'n_words': 511}