<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace GoogleApi.Helpers
{
    /// <summary>
    /// Helper class to build querystrings for Google Requests.
    /// </summary>
    public sealed class QueryStringParametersList : Dictionary<string, string>, IDictionary<string, string>
    {
        /// <summary>
        /// Adds a parameter.
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        public new void Add(string key, string value)
        {
            if (key == null)
                throw new ArgumentNullException(nameof(key));

            if (value == null)
                throw new ArgumentNullException(nameof(value));

            if (base.ContainsKey(key))
            {
                base[key] = value;
            }
            else
            {
                base.Add(key, value);
            }
        }

        /// <summary>
        /// Remove a parameter.
        /// </summary>
        /// <param name="key"></param>
        public new bool Remove(string key)
        {
            if (key == null)
                throw new ArgumentNullException(nameof(key));

            base.Remove(key);

            return true;
        }

        /// <summary>
        /// returns the query string collection as url paremer string.
        ///  </summary>
        /// <returns></returns>
        public string GetQueryStringPostfix()
        {
            return string.Join("&", this.Select(x => Uri.EscapeDataString(x.Key) + "=" + Uri.EscapeDataString(x.Value)));
        }
    }
}<commit_msg>Remove unused overload of Remove for QueryStringParametersList<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace GoogleApi.Helpers
{
    /// <summary>
    /// Helper class to build querystrings for Google Requests.
    /// </summary>
    public sealed class QueryStringParametersList : Dictionary<string, string>, IDictionary<string, string>
    {
        /// <summary>
        /// Adds a parameter.
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        public new void Add(string key, string value)
        {
            if (key == null)
                throw new ArgumentNullException(nameof(key));

            if (value == null)
                throw new ArgumentNullException(nameof(value));

            if (base.ContainsKey(key))
            {
                base[key] = value;
            }
            else
            {
                base.Add(key, value);
            }
        }

        /// <summary>
        /// returns the query string collection as url paremer string.
        ///  </summary>
        /// <returns></returns>
        public string GetQueryStringPostfix()
        {
            return string.Join("&", this.Select(x => Uri.EscapeDataString(x.Key) + "=" + Uri.EscapeDataString(x.Value)));
        }
    }
}
{'fraction_non_alphanumeric': 0.1293599729089062, 'fraction_numerical': 0.0, 'mean_word_length': 1.5866900175131349, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 37, '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': '3009032', 'n_tokens_mistral': 781, 'n_tokens_neox': 758, 'n_words': 189}