<commit_before>#region auto-generated FILE INFORMATION

// ==============================================
// This file is distributed under the MIT License
// ==============================================
// 
// Filename: NetEx.cs
// Version:  2020-01-13 13:04
// 
// Copyright (c) 2020, Si13n7 Developments(tm)
// All rights reserved.
// ______________________________________________

#endregion

namespace SilDev.Network
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;
    using System.Linq;
    using System.Net;
    using System.Net.NetworkInformation;
    using Properties;

    /// <summary>
    ///     Provides functionality for the access of internet resources.
    /// </summary>
    public static class NetEx
    {
        /// <summary>
        ///     Provides options for specifying a Domain Name System provider.
        /// </summary>
        [SuppressMessage("ReSharper", "CommentTypo")]
        public enum DnsOption
        {
            /// <summary>
            ///     Partnership between Cloudflare and APNIC. Cloudflare runs one of the
            ///     worlds largest, fastest networks. APNIC is a non-profit organization
            ///     managing IP address allocation for the Asia Pacific and Oceania regions.
            ///     Cloudflare had the network. APNIC had the IP address (1.1.1.1). Both were
            ///     motivated by a mission to help build a better Internet.
            /// </summary>
            Cloudflare,

            /// <summary>
            ///     A free, global DNS resolution service that you can use as an alternative to
            ///     your current DNS provider. In addition to traditional DNS over UDP or TCP,
            ///     Google also provide DNS-over-HTTPS API.
            /// </summary>
            Google
        }

        private static bool _defSecurityProtocolIsEnabled;
        private static bool? _ipv4IsAvalaible, _ipv6IsAvalaible;

        /// <summary>
        ///     Gets internal download mirrors.
        /// </summary>
        public static IReadOnlyList<string> InternalDownloadMirrors { get; } = new[]
        {
            "https://dl.si13n7.com",
            "https://dl.si13n7.de",
            "http://dl-0.de",
            "http://dl-1.de",
            "http://dl-2.de",
            "http://dl-3.de",
            "http://dl-4.de",
            "http://dl-5.de"
        };

        /// <summary>
        ///     Determines whether the current IPv4 connection is available.
        /// </summary>
        [SuppressMessage("ReSharper", "InconsistentNaming")]
        public static bool IPv4IsAvalaible
        {
            get
            {
                if (!_ipv4IsAvalaible.HasValue)
                    _ipv4IsAvalaible = InternetIsAvailable();
                return (bool)_ipv4IsAvalaible;
            }
        }

        /// <summary>
        ///     Determines whether the current IPv6 connection is available.
        /// </summary>
        [SuppressMessage("ReSharper", "InconsistentNaming")]
        public static bool IPv6IsAvalaible
        {
            get
            {
                if (!_ipv6IsAvalaible.HasValue)
                    _ipv6IsAvalaible = InternetIsAvailable(true);
                return (bool)_ipv6IsAvalaible;
            }
        }

        /// <summary>
        ///     Gets the last result defined in the previous call to the
        ///     <see cref="Ping(Uri, int)"/> function.
        /// </summary>
        public static PingReply LastPingReply { get; private set; }

        internal static void EnsureDefaultSecurityProtocol()
        {
            if (_defSecurityProtocolIsEnabled)
                return;
            _defSecurityProtocolIsEnabled = true;
            foreach (var type in Enum.GetValues(typeof(SecurityProtocolType)).Cast<SecurityProtocolType>().Where(type => type != SecurityProtocolType.SystemDefault))
                ServicePointManager.SecurityProtocol |= type;
        }

        /// <summary>
        ///     Returns the specified Domain Name System server addresses.
        /// </summary><commit_msg>Clean up code style of NetEx properties.<commit_after>#region auto-generated FILE INFORMATION

// ==============================================
// This file is distributed under the MIT License
// ==============================================
// 
// Filename: NetEx.cs
// Version:  2020-01-13 14:00
// 
// Copyright (c) 2020, Si13n7 Developments(tm)
// All rights reserved.
// ______________________________________________

#endregion

namespace SilDev.Network
{
    using System;
    using System.Collections.Generic;
    using System.Diagnostics.CodeAnalysis;
    using System.Linq;
    using System.Net;
    using System.Net.NetworkInformation;
    using Properties;

    /// <summary>
    ///     Provides functionality for the access of internet resources.
    /// </summary>
    public static class NetEx
    {
        /// <summary>
        ///     Provides options for specifying a Domain Name System provider.
        /// </summary>
        [SuppressMessage("ReSharper", "CommentTypo")]
        public enum DnsOption
        {
            /// <summary>
            ///     Partnership between Cloudflare and APNIC. Cloudflare runs one of the
            ///     worlds largest, fastest networks. APNIC is a non-profit organization
            ///     managing IP address allocation for the Asia Pacific and Oceania regions.
            ///     Cloudflare had the network. APNIC had the IP address (1.1.1.1). Both were
            ///     motivated by a mission to help build a better Internet.
            /// </summary>
            Cloudflare,

            /// <summary>
            ///     A free, global DNS resolution service that you can use as an alternative to
            ///     your current DNS provider. In addition to traditional DNS over UDP or TCP,
            ///     Google also provide DNS-over-HTTPS API.
            /// </summary>
            Google
        }

        private static bool _defSecurityProtocolIsEnabled;
        private static bool? _ipv4IsAvalaible, _ipv6IsAvalaible;

        /// <summary>
        ///     Gets internal download mirrors.
        /// </summary>
        public static IReadOnlyList<string> InternalDownloadMirrors { get; } = new[]
        {
            "https://dl.si13n7.com",
            "https://dl.si13n7.de",
            "http://dl-0.de",
            "http://dl-1.de",
            "http://dl-2.de",
            "http://dl-3.de",
            "http://dl-4.de",
            "http://dl-5.de"
        };

        /// <summary>
        ///     Determines whether the current IPv4 connection is available.
        /// </summary>
        [SuppressMessage("ReSharper", "InconsistentNaming")]
        public static bool IPv4IsAvalaible => _ipv4IsAvalaible ??= InternetIsAvailable();

        /// <summary>
        ///     Determines whether the current IPv6 connection is available.
        /// </summary>
        [SuppressMessage("ReSharper", "InconsistentNaming")]
        public static bool IPv6IsAvalaible => _ipv6IsAvalaible ??= InternetIsAvailable(true);

        /// <summary>
        ///     Gets the last result defined in the previous call to the
        ///     <see cref="Ping(Uri, int)"/> function.
        /// </summary>
        public static PingReply LastPingReply { get; private set; }

        internal static void EnsureDefaultSecurityProtocol()
        {
            if (_defSecurityProtocolIsEnabled)
                return;
            _defSecurityProtocolIsEnabled = true;
            foreach (var type in Enum.GetValues(typeof(SecurityProtocolType)).Cast<SecurityProtocolType>().Where(type => type != SecurityProtocolType.SystemDefault))
                ServicePointManager.SecurityProtocol |= type;
        }

        /// <summary>
        ///     Returns the specified Domain Name System server addresses.
        /// </summary>
{'fraction_non_alphanumeric': 0.12548772813089995, 'fraction_numerical': 0.011327879169288861, 'mean_word_length': 1.8097595473833097, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 49, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '940471', 'n_tokens_mistral': 2075, 'n_tokens_neox': 2000, 'n_words': 573}