<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using InfluxDB.Net.Client;
using InfluxDB.Net.Contracts;
using InfluxDB.Net.Enums;
using InfluxDB.Net.Helpers;
using InfluxDB.Net.Infrastructure.Configuration;
using InfluxDB.Net.Infrastructure.Influx;
using InfluxDB.Net.Infrastructure.Validation;
using InfluxDB.Net.Models;

namespace InfluxDB.Net
{
    public class InfluxDb : IInfluxDb
    {
        internal readonly IEnumerable<ApiResponseErrorHandlingDelegate> NoErrorHandlers = Enumerable.Empty<ApiResponseErrorHandlingDelegate>();

        private readonly IInfluxDbClient _influxDbClient;

        public InfluxDb(string url, string username, string password, InfluxVersion influxVersion = InfluxVersion.Auto, TimeSpan? requestTimeout = null)
             : this(new InfluxDbClientConfiguration(new Uri(url), username, password, influxVersion, requestTimeout))
        {
            Validate.NotNullOrEmpty(url, "The URL may not be null or empty.");
            Validate.NotNullOrEmpty(username, "The username may not be null or empty.");
        }

        internal InfluxDb(InfluxDbClientConfiguration influxDbClientConfiguration)
        {
            switch (influxDbClientConfiguration.InfluxVersion)
            {
                case InfluxVersion.Auto:
                    _influxDbClient = new InfluxDbClientAutoVersion(influxDbClientConfiguration);
                    break;
                case InfluxVersion.v012x:
                    _influxDbClient = new InfluxDbClientV012x(influxDbClientConfiguration);
                    break;
                case InfluxVersion.v011x:<commit_msg>InfluxVersion.v013x results in ArgumentOutOfRangeException<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using InfluxDB.Net.Client;
using InfluxDB.Net.Contracts;
using InfluxDB.Net.Enums;
using InfluxDB.Net.Helpers;
using InfluxDB.Net.Infrastructure.Configuration;
using InfluxDB.Net.Infrastructure.Influx;
using InfluxDB.Net.Infrastructure.Validation;
using InfluxDB.Net.Models;

namespace InfluxDB.Net
{
    public class InfluxDb : IInfluxDb
    {
        internal readonly IEnumerable<ApiResponseErrorHandlingDelegate> NoErrorHandlers = Enumerable.Empty<ApiResponseErrorHandlingDelegate>();

        private readonly IInfluxDbClient _influxDbClient;

        public InfluxDb(string url, string username, string password, InfluxVersion influxVersion = InfluxVersion.Auto, TimeSpan? requestTimeout = null)
             : this(new InfluxDbClientConfiguration(new Uri(url), username, password, influxVersion, requestTimeout))
        {
            Validate.NotNullOrEmpty(url, "The URL may not be null or empty.");
            Validate.NotNullOrEmpty(username, "The username may not be null or empty.");
        }

        internal InfluxDb(InfluxDbClientConfiguration influxDbClientConfiguration)
        {
            switch (influxDbClientConfiguration.InfluxVersion)
            {
                case InfluxVersion.Auto:
                    _influxDbClient = new InfluxDbClientAutoVersion(influxDbClientConfiguration);
                    break;
                case InfluxVersion.v013x:
                    _influxDbClient = new InfluxDbClientV013x(influxDbClientConfiguration);
                    break;
                case InfluxVersion.v012x:
                    _influxDbClient = new InfluxDbClientV012x(influxDbClientConfiguration);
                    break;
                case InfluxVersion.v011x:
{'fraction_non_alphanumeric': 0.0676056338028169, 'fraction_numerical': 0.007605633802816901, 'mean_word_length': 3.086306098964327, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3915004', 'n_tokens_mistral': 1010, 'n_tokens_neox': 915, 'n_words': 200}