<commit_before>using System;
using FluentSecurity.ServiceLocation;

namespace FluentSecurity
{
	public static class SecurityConfigurator
	{
		private static readonly object LockObject = new object();

		internal static Guid CorrelationId { get; private set; }

		static SecurityConfigurator()
		{
			CorrelationId = Guid.NewGuid();
		}

		public static ISecurityConfiguration Configure(Action<ConfigurationExpression> configurationExpression)
		{
			if (configurationExpression == null)
				throw new ArgumentNullException("configurationExpression");

			Reset();
			lock (LockObject)
			{
				var configuration = new SecurityConfiguration(configurationExpression);
				SecurityConfiguration.SetConfiguration(configuration);
				return SecurityConfiguration.Current;
			}
		}

		public static void SetConfiguration(ISecurityConfiguration configuration)
		{
			if (configuration == null)
				throw new ArgumentNullException("configuration");

			Reset();
			lock (LockObject)
			{
				SecurityConfiguration.SetConfiguration(configuration);
			}
		}
<commit_msg>- Publishing configuration events from SecurityConfigurator.<commit_after>using System;
using FluentSecurity.Diagnostics;
using FluentSecurity.ServiceLocation;

namespace FluentSecurity
{
	public static class SecurityConfigurator
	{
		private static readonly object LockObject = new object();

		internal static Guid CorrelationId { get; private set; }

		static SecurityConfigurator()
		{
			CorrelationId = Guid.NewGuid();
		}

		public static ISecurityConfiguration Configure(Action<ConfigurationExpression> configurationExpression)
		{
			if (configurationExpression == null)
				throw new ArgumentNullException("configurationExpression");

			Reset();

			Publish.ConfigurationEvent(() => "Configuring FluentSecurity.");

			lock (LockObject)
			{
				return Publish.ConfigurationEvent(() =>
				{
					var configuration = new SecurityConfiguration(configurationExpression);
					SecurityConfiguration.SetConfiguration(configuration);
					return SecurityConfiguration.Current;
				}, config => "Finished configuring FluentSecurity.");
			}
		}

		public static void SetConfiguration(ISecurityConfiguration configuration)
		{
			if (configuration == null)
				throw new ArgumentNullException("configuration");

			Reset();
			lock (LockObject)
			{
				SecurityConfiguration.SetConfiguration(configuration);
			}
		}

{'fraction_non_alphanumeric': 0.08102434928631402, 'fraction_numerical': 0.0, 'mean_word_length': 4.942643391521197, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 8, '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': '395266', 'n_tokens_mistral': 693, 'n_tokens_neox': 557, 'n_words': 144}