<commit_before>﻿// -----------------------------------------------------------------------
//  <copyright file="Utility.cs" company="Binary Overdrive">
//      Copyright (c) Binary Overdrive.
//  </copyright>
//  <project>BotSuite.Net</project>
//  <purpose>Framework for creating automation applications.</purpose>
//  <homepage>https://bitbucket.org/KarillEndusa/botsuite.net</homepage>
//  <license>https://bitbucket.org/KarillEndusa/botsuite.net/wiki/license</license>
// -----------------------------------------------------------------------

namespace BotSuite
{
	using System;
	using System.Threading;

	/// <summary>
	///     commons functions
	/// </summary>
	public class Utility
	{
		private static readonly Random _random = new Random();

		/// <summary>
		///     pause the current thread for x ms
		/// </summary>
		/// <param name="lower">
		///     min time
		/// </param>
		/// <param name="upper">
		///     max time
		/// </param>
		public static void RandomDelay(int lower = 10, int upper = 30)
		{
			Delay(RandomInt(lower, upper));
		}

		/// <summary>
		///     pause the current thread for x ms
		/// </summary>
		/// <param name="x">
		///     The x.
		/// </param>
		public static void Delay(int x = 10000)
		{
			Thread.Sleep(x);
		}

		/// <summary>
		///     create a random integer between lower and upper
		/// </summary>
		/// <param name="lower">
		///     min number
		/// </param>
		/// <param name="upper">
		///     max number
		/// </param>
		/// <returns>
		///     random integer
		/// </returns>
		public static int RandomInt(int lower, int upper)
		{
			return _random.Next(lower, upper);
		}

		/// <summary>
		///     create a random double between lower and upper
		/// </summary>
		/// <param name="lower">
		///     min number
		/// </param>
		/// <param name="upper">
		///     max number
		/// </param>
		/// <returns>
		///     random double
		/// </returns>
		public static double RandomDouble(double lower, double upper)
		{
			return _random.NextDouble() * (upper - lower + upper);
		}
	}
}<commit_msg>RandomDouble erzeugt jetzt korrekte Werte.<commit_after>﻿// -----------------------------------------------------------------------
//  <copyright file="Utility.cs" company="Binary Overdrive">
//      Copyright (c) Binary Overdrive.
//  </copyright>
//  <project>BotSuite.Net</project>
//  <purpose>Framework for creating automation applications.</purpose>
//  <homepage>https://bitbucket.org/KarillEndusa/botsuite.net</homepage>
//  <license>https://bitbucket.org/KarillEndusa/botsuite.net/wiki/license</license>
// -----------------------------------------------------------------------

namespace BotSuite
{
	using System;
	using System.Threading;

	/// <summary>
	///     commons functions
	/// </summary>
	public class Utility
	{
	    /// <summary>
	    /// The random generator.
	    /// </summary>
	    private static readonly Random Random = new Random();

		/// <summary>
		///     pause the current thread for x ms
		/// </summary>
		/// <param name="lower">
		///     min time
		/// </param>
		/// <param name="upper">
		///     max time
		/// </param>
		public static void RandomDelay(int lower = 10, int upper = 30)
		{
			Delay(RandomInt(lower, upper));
		}

		/// <summary>
		///     pause the current thread for x ms
		/// </summary>
		/// <param name="x">
		///     The x.
		/// </param>
		public static void Delay(int x = 1000)
		{
			Thread.Sleep(x);
		}

		/// <summary>
		///     create a random integer between lower and upper
		/// </summary>
		/// <param name="lower">
		///     min number
		/// </param>
		/// <param name="upper">
		///     max number
		/// </param>
		/// <returns>
		///     random integer
		/// </returns>
		public static int RandomInt(int lower, int upper)
		{
			return Random.Next(lower, upper);
		}

		/// <summary>
		///     create a random double between lower and upper
		/// </summary>
		/// <param name="lower">
		///     min number
		/// </param>
		/// <param name="upper">
		///     max number
		/// </param>
		/// <returns>
		///     random double
		/// </returns>
		public static double RandomDouble(double lower, double upper)
		{
			return (Random.NextDouble() * (upper - lower)) + lower;
		}
	}
}
{'fraction_non_alphanumeric': 0.2378917378917379, 'fraction_numerical': 0.004036087369420703, 'mean_word_length': 1.7128139085640695, 'pattern_counts': {'":': 0, '<': 81, '<?xml version=': 0, '>': 81, 'https://': 4, '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': '1831422', 'n_tokens_mistral': 1410, 'n_tokens_neox': 1245, 'n_words': 327}