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

namespace KornelijePetak.IncidentCS
{
	public static partial class Incident
	{
		/// <summary>
		/// Generates random primitive values
		/// </summary>
		public static class Primitive
		{
			/// <summary>
			/// Gets a random boolean (true or false)
			/// </summary>
			public static bool Boolean
			{
				get
				{
					return Rand.NextDouble() < 0.5;
				}
			}

			/// <summary>
			/// Gets a random byte from interval [0, 255]
			/// </summary>
			public static byte Byte
			{
				get
				{
					return (Byte)Rand.Next(256);
				}
			}

			/// <summary>
			/// Gets a random byte between <paramref name="start"/> and <paramref name="end"/>
			/// </summary>
			/// <exception cref="System.ArgumentException">The value of <paramref name="start"/> is greater than the value of <paramref name="end"/></exception>
			/// <exception cref="System.ArgumentOutOfRangeException">The value of <paramref name="start"/> is less than 0.</exception>
			/// <exception cref="System.ArgumentOutOfRangeException">The value of <paramref name="end"/> is greater than 256.</exception>
			/// <param name="start">Inclusive lower bound</param>
			/// <param name="end">Exclusive upper bound</param>
			/// <returns>A random byte in specified interval</returns>
			public static byte ByteBetween(int start, int end)
			{
				if (start > end)
					throw new ArgumentException("The value of 'start' must be less than the value of 'end'!");

				if (start < 0)
					throw new ArgumentOutOfRangeException("The value of 'start' must be non-negative.");

				if (end > 256)
					throw new ArgumentOutOfRangeException("The value of 'end' must be less than or equal 256.");

				return (byte)Rand.Next(start, end);
			}

			/// <summary>
			/// Gets a random signed byte from interval [-128, 127]
			/// </summary>
			public static sbyte SignedByte
			{
				get
				{
					return Convert.ToSByte(Byte - 128);
				}
			}

			/// <summary>
			/// Gets a random signed byte between <paramref name="start"/> and <paramref name="end"/>
			/// </summary>
			/// <exception cref="System.ArgumentException">The value of <paramref name="start"/> is greater than the value of <paramref name="end"/></exception>
			/// <exception cref="System.ArgumentOutOfRangeException">The value of <paramref name="start"/> is less than -128.</exception>
			/// <exception cref="System.ArgumentOutOfRangeException">The value of <paramref name="end"/> is greater than 128.</exception>
			/// <param name="start">Inclusive lower bound</param>
			/// <param name="end">Exclusive upper bound</param>
			/// <returns>A random signed byte in specified interval</returns>
			public static sbyte SignedByteBetween(int start, int end)
			{
				if (start > end)
					throw new ArgumentException("The value of 'start' must be less than the value of 'end'!");

				if (start < -128)
					throw new ArgumentOutOfRangeException("The value of 'start' must be greater than or equal -128.");

				if (end > 128)
					throw new ArgumentOutOfRangeException("The value of 'end' must be less than or equal 128.");

				return (sbyte)Rand.Next(start, end);
			}

			/// <summary>
			/// Gets a random short from interval [-32768, 32767]
			/// </summary>
			public static short Short
			{
				get
				{
					byte[] shortArray = new byte[2];
					Rand.NextBytes(shortArray);
					return BitConverter.ToInt16(shortArray, 0);
				}
			}

			/// <summary>
			/// Gets a random positive short from interval [0, 32767]
			/// </summary>
			public static short PositiveShort
			{
				get
				{
					return (short)Rand.Next(0, short.MaxValue);
				}
			}

			/// <summary>
			/// Gets a random short between <paramref name="start"/> and <paramref name="end"/>
			/// </summary>
			/// <exception cref="System.ArgumentException">The value of <paramref name="start"/> is greater than the value of <paramref name="end"/></exception>
			/// <exception cref="System.ArgumentOutOfRangeException">The value of <paramref name="start"/> is less than -32768.</exception>
			/// <exception cref="System.ArgumentOutOfRangeException">The value of <paramref name="end"/> is greater than 32768.</exception>
			/// <param name="start">Inclusive lower bound</param>
			/// <param name="end">Exclusive upper bound</param>
			/// <returns>A random short in specified interval</returns>
			public static short ShortBetween(int start, int end)
			{
				if (start > end)
					throw new ArgumentException("The value of 'start' must be less than the value of 'end'!");

				if (start < -32768)
					throw new ArgumentOutOfRangeException("The value of 'start' must be greater than or equal -32768.");

				if (end > 32768)
					throw new ArgumentOutOfRangeException("The value of 'end' must be less than or equal 32768.");

				return (short)Rand.Next(start, end);
			}


			/// <summary>
			/// Gets a random unsigned short from interval [0, 65535]
			/// </summary>
			public static ushort UnsignedShort
			{
				get
				{
					byte[] ushortArray = new byte[2];
					Rand.NextBytes(ushortArray);
					return BitConverter.ToUInt16(ushortArray, 0);
				}
			}

			/// <summary>
			/// Gets a random unsigned short between <paramref name="start"/> and <paramref name="end"/>
			/// </summary>
			/// <exception cref="System.ArgumentException">The value of <paramref name="start"/> is greater than the value of <paramref name="end"/></exception>
			/// <exception cref="System.ArgumentOutOfRangeException">The value of <paramref name="start"/> is less than 0.</exception>
			/// <exception cref="System.ArgumentOutOfRangeException">The value of <paramref name="end"/> is greater than 65536.</exception>
			/// <param name="start">Inclusive lower bound</param>
			/// <param name="end">Exclusive upper bound</param>
			/// <returns>A random unsigned short in specified interval</returns>
			public static ushort UnsignedShortBetween(int start, int end)
			{
				if (start > end)
					throw new ArgumentException("The value of 'start' must be less than the value of 'end'!");

				if (start < 0)<commit_msg>Add Incident.Primitive.Guid<commit_after>﻿using System;
using System.Linq;

namespace KornelijePetak.IncidentCS
{
	public static partial class Incident
	{
		/// <summary>
		/// Generates random primitive values
		/// </summary>
		public static class Primitive
		{
			/// <summary>
			/// Gets a random boolean (true or false)
			/// </summary>
			public static bool Boolean
			{
				get
				{
					return Rand.NextDouble() < 0.5;
				}
			}

			/// <summary>
			/// Returns a new random GUID
			/// </summary>
			public static Guid Guid
			{
				get
				{
					return new Guid();
				}
			}


			/// <summary>
			/// Gets a random byte from interval [0, 255]
			/// </summary>
			public static byte Byte
			{
				get
				{
					return (Byte)Rand.Next(256);
				}
			}

			/// <summary>
			/// Gets a random byte between <paramref name="start"/> and <paramref name="end"/>
			/// </summary>
			/// <exception cref="System.ArgumentException">The value of <paramref name="start"/> is greater than the value of <paramref name="end"/></exception>
			/// <exception cref="System.ArgumentOutOfRangeException">The value of <paramref name="start"/> is less than 0.</exception>
			/// <exception cref="System.ArgumentOutOfRangeException">The value of <paramref name="end"/> is greater than 256.</exception>
			/// <param name="start">Inclusive lower bound</param>
			/// <param name="end">Exclusive upper bound</param>
			/// <returns>A random byte in specified interval</returns>
			public static byte ByteBetween(int start, int end)
			{
				if (start > end)
					throw new ArgumentException("The value of 'start' must be less than the value of 'end'!");

				if (start < 0)
					throw new ArgumentOutOfRangeException("The value of 'start' must be non-negative.");

				if (end > 256)
					throw new ArgumentOutOfRangeException("The value of 'end' must be less than or equal 256.");

				return (byte)Rand.Next(start, end);
			}

			/// <summary>
			/// Gets a random signed byte from interval [-128, 127]
			/// </summary>
			public static sbyte SignedByte
			{
				get
				{
					return Convert.ToSByte(Byte - 128);
				}
			}

			/// <summary>
			/// Gets a random signed byte between <paramref name="start"/> and <paramref name="end"/>
			/// </summary>
			/// <exception cref="System.ArgumentException">The value of <paramref name="start"/> is greater than the value of <paramref name="end"/></exception>
			/// <exception cref="System.ArgumentOutOfRangeException">The value of <paramref name="start"/> is less than -128.</exception>
			/// <exception cref="System.ArgumentOutOfRangeException">The value of <paramref name="end"/> is greater than 128.</exception>
			/// <param name="start">Inclusive lower bound</param>
			/// <param name="end">Exclusive upper bound</param>
			/// <returns>A random signed byte in specified interval</returns>
			public static sbyte SignedByteBetween(int start, int end)
			{
				if (start > end)
					throw new ArgumentException("The value of 'start' must be less than the value of 'end'!");

				if (start < -128)
					throw new ArgumentOutOfRangeException("The value of 'start' must be greater than or equal -128.");

				if (end > 128)
					throw new ArgumentOutOfRangeException("The value of 'end' must be less than or equal 128.");

				return (sbyte)Rand.Next(start, end);
			}

			/// <summary>
			/// Gets a random short from interval [-32768, 32767]
			/// </summary>
			public static short Short
			{
				get
				{
					byte[] shortArray = new byte[2];
					Rand.NextBytes(shortArray);
					return BitConverter.ToInt16(shortArray, 0);
				}
			}

			/// <summary>
			/// Gets a random positive short from interval [0, 32767]
			/// </summary>
			public static short PositiveShort
			{
				get
				{
					return (short)Rand.Next(0, short.MaxValue);
				}
			}

			/// <summary>
			/// Gets a random short between <paramref name="start"/> and <paramref name="end"/>
			/// </summary>
			/// <exception cref="System.ArgumentException">The value of <paramref name="start"/> is greater than the value of <paramref name="end"/></exception>
			/// <exception cref="System.ArgumentOutOfRangeException">The value of <paramref name="start"/> is less than -32768.</exception>
			/// <exception cref="System.ArgumentOutOfRangeException">The value of <paramref name="end"/> is greater than 32768.</exception>
			/// <param name="start">Inclusive lower bound</param>
			/// <param name="end">Exclusive upper bound</param>
			/// <returns>A random short in specified interval</returns>
			public static short ShortBetween(int start, int end)
			{
				if (start > end)
					throw new ArgumentException("The value of 'start' must be less than the value of 'end'!");

				if (start < -32768)
					throw new ArgumentOutOfRangeException("The value of 'start' must be greater than or equal -32768.");

				if (end > 32768)
					throw new ArgumentOutOfRangeException("The value of 'end' must be less than or equal 32768.");

				return (short)Rand.Next(start, end);
			}

			/// <summary>
			/// Gets a random unsigned short from interval [0, 65535]
			/// </summary>
			public static ushort UnsignedShort
			{
				get
				{
					byte[] ushortArray = new byte[2];
					Rand.NextBytes(ushortArray);
					return BitConverter.ToUInt16(ushortArray, 0);
				}
			}

			/// <summary>
			/// Gets a random unsigned short between <paramref name="start"/> and <paramref name="end"/>
			/// </summary>
			/// <exception cref="System.ArgumentException">The value of <paramref name="start"/> is greater than the value of <paramref name="end"/></exception>
			/// <exception cref="System.ArgumentOutOfRangeException">The value of <paramref name="start"/> is less than 0.</exception>
			/// <exception cref="System.ArgumentOutOfRangeException">The value of <paramref name="end"/> is greater than 65536.</exception>
			/// <param name="start">Inclusive lower bound</param>
			/// <param name="end">Exclusive upper bound</param>
			/// <returns>A random unsigned short in specified interval</returns>
			public static ushort UnsignedShortBetween(int start, int end)
			{
				if (start > end)
					throw new ArgumentException("The value of 'start' must be less than the value of 'end'!");

				if (start < 0)
{'fraction_non_alphanumeric': 0.14007178985152555, 'fraction_numerical': 0.018763256648719202, 'mean_word_length': 3.0432058047493404, 'pattern_counts': {'":': 0, '<': 203, '<?xml version=': 0, '>': 207, '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': '7227535', 'n_tokens_mistral': 4432, 'n_tokens_neox': 3466, 'n_words': 1183}