<commit_before>﻿using System.Collections.Generic;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Validator.Engine;
using NHibernate.Validator.Cfg;
using SharpArch.Core;
using FluentNHibernate;
using FluentNHibernate.Cfg;
using System.Reflection;
using FluentNHibernate.Automapping;
using System.Linq;
using FluentNHibernate.Cfg.Db;
using System;
using System.IO;

namespace SharpArch.Data.NHibernate
{
	public static class NHibernateSession
	{
		#region Init() overloads

		public static Configuration Init(ISessionStorage storage, string[] mappingAssemblies)
		{
			return Init(storage, mappingAssemblies, null, null, null, null, null);
		}

		public static Configuration Init(ISessionStorage storage, string[] mappingAssemblies, string cfgFile)
		{
			return Init(storage, mappingAssemblies, null, cfgFile, null, null, null);
		}

		public static Configuration Init(ISessionStorage storage, string[] mappingAssemblies, IDictionary<string, string> cfgProperties)
		{
			return Init(storage, mappingAssemblies, null, null, cfgProperties, null, null);
		}

		public static Configuration Init(ISessionStorage storage, string[] mappingAssemblies, string cfgFile, string validatorCfgFile)
		{
			return Init(storage, mappingAssemblies, null, cfgFile, null, validatorCfgFile, null);
		}

		[CLSCompliant(false)]
		public static Configuration Init(ISessionStorage storage, string[] mappingAssemblies, AutoPersistenceModel autoPersistenceModel)
		{
			return Init(storage, mappingAssemblies, autoPersistenceModel, null, null, null, null);
		}

		[CLSCompliant(false)]
		public static Configuration Init(ISessionStorage storage, string[] mappingAssemblies, AutoPersistenceModel autoPersistenceModel, string cfgFile)
		{
			return Init(storage, mappingAssemblies, autoPersistenceModel, cfgFile, null, null, null);
		}

		[CLSCompliant(false)]
		public static Configuration Init(ISessionStorage storage, string[] mappingAssemblies, AutoPersistenceModel autoPersistenceModel, IDictionary<string, string> cfgProperties)
		{
			return Init(storage, mappingAssemblies, autoPersistenceModel, null, cfgProperties, null, null);
		}

		[CLSCompliant(false)]
		public static Configuration Init(
			ISessionStorage storage, 
			string[] mappingAssemblies,
			AutoPersistenceModel autoPersistenceModel,
			string cfgFile,
			string validatorCfgFile)
		{
			return Init(storage, mappingAssemblies, autoPersistenceModel, cfgFile, null, validatorCfgFile, null);
		}

		[CLSCompliant(false)]
		public static Configuration Init(
			ISessionStorage storage, 
			string[] mappingAssemblies,
			AutoPersistenceModel autoPersistenceModel,
			string cfgFile,
			IDictionary<string, string> cfgProperties,
			string validatorCfgFile)
		{
			return Init(storage, mappingAssemblies, autoPersistenceModel, cfgFile, cfgProperties, validatorCfgFile, null);
		}

		[CLSCompliant(false)]
		public static Configuration Init(
			ISessionStorage storage,
			string[] mappingAssemblies,
			AutoPersistenceModel autoPersistenceModel,
			string cfgFile,
			IDictionary<string, string> cfgProperties,
			string validatorCfgFile,
			IPersistenceConfigurer persistenceConfigurer)
		{
			InitStorage(storage);
			return AddConfiguration(DefaultFactoryKey, mappingAssemblies, autoPersistenceModel, cfgFile, cfgProperties, validatorCfgFile, persistenceConfigurer);
		}<commit_msg>Fix for NHibernateSession.Init<commit_after>﻿using System.Collections.Generic;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Validator.Engine;
using NHibernate.Validator.Cfg;
using SharpArch.Core;
using FluentNHibernate;
using FluentNHibernate.Cfg;
using System.Reflection;
using FluentNHibernate.Automapping;
using System.Linq;
using FluentNHibernate.Cfg.Db;
using System;
using System.IO;

namespace SharpArch.Data.NHibernate
{
	public static class NHibernateSession
	{
		#region Init() overloads

		public static Configuration Init(ISessionStorage storage, string[] mappingAssemblies)
		{
			return Init(storage, mappingAssemblies, null, null, null, null, null);
		}

		public static Configuration Init(ISessionStorage storage, string[] mappingAssemblies, string cfgFile)
		{
			return Init(storage, mappingAssemblies, null, cfgFile, null, null, null);
		}

		public static Configuration Init(ISessionStorage storage, string[] mappingAssemblies, IDictionary<string, string> cfgProperties)
		{
			return Init(storage, mappingAssemblies, null, null, cfgProperties, null, null);
		}

		public static Configuration Init(ISessionStorage storage, string[] mappingAssemblies, string cfgFile, string validatorCfgFile)
		{
			return Init(storage, mappingAssemblies, null, cfgFile, null, validatorCfgFile, null);
		}

		[CLSCompliant(false)]
		public static Configuration Init(ISessionStorage storage, string[] mappingAssemblies, AutoPersistenceModel autoPersistenceModel)
		{
			return Init(storage, mappingAssemblies, autoPersistenceModel, null, null, null, null);
		}

		[CLSCompliant(false)]
		public static Configuration Init(ISessionStorage storage, string[] mappingAssemblies, AutoPersistenceModel autoPersistenceModel, string cfgFile)
		{
			return Init(storage, mappingAssemblies, autoPersistenceModel, cfgFile, null, null, null);
		}

		[CLSCompliant(false)]
		public static Configuration Init(ISessionStorage storage, string[] mappingAssemblies, AutoPersistenceModel autoPersistenceModel, IDictionary<string, string> cfgProperties)
		{
			return Init(storage, mappingAssemblies, autoPersistenceModel, null, cfgProperties, null, null);
		}

		[CLSCompliant(false)]
		public static Configuration Init(
			ISessionStorage storage, 
			string[] mappingAssemblies,
			AutoPersistenceModel autoPersistenceModel,
			string cfgFile,
			string validatorCfgFile)
		{
			return Init(storage, mappingAssemblies, autoPersistenceModel, cfgFile, null, validatorCfgFile, null);
		}

		[CLSCompliant(false)]
		public static Configuration Init(
			ISessionStorage storage, 
			string[] mappingAssemblies,
			AutoPersistenceModel autoPersistenceModel,
			string cfgFile,
			IDictionary<string, string> cfgProperties,
			string validatorCfgFile)
		{
			return Init(storage, mappingAssemblies, autoPersistenceModel, cfgFile, cfgProperties, validatorCfgFile, null);
		}

		[CLSCompliant(false)]
		public static Configuration Init(
			ISessionStorage storage,
			string[] mappingAssemblies,
			AutoPersistenceModel autoPersistenceModel,
			string cfgFile,
			IDictionary<string, string> cfgProperties,
			string validatorCfgFile,
			IPersistenceConfigurer persistenceConfigurer)
		{
			InitStorage(storage);
            try {
                return AddConfiguration(DefaultFactoryKey, mappingAssemblies, autoPersistenceModel, cfgFile, cfgProperties, validatorCfgFile, persistenceConfigurer);
            }
            catch {
                // If this NHibernate config throws an exception, null the Storage reference so 
                // the config can be corrected without having to restart the web application.
                Storage = null;
                throw;
            }
		}
{'fraction_non_alphanumeric': 0.07606837606837606, 'fraction_numerical': 0.0, 'mean_word_length': 5.470967741935484, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '826549', 'n_tokens_mistral': 2170, 'n_tokens_neox': 1892, 'n_words': 517}