<commit_before>using System;
using System.Collections.Generic;
using System.Linq;
using Affecto.AuditTrail.Interfaces;
using Affecto.AuditTrail.Interfaces.Model;
using Affecto.AuthenticationServer.IdentityManagement.Configuration;
using Affecto.AuthenticationServer.Infrastructure.Configuration;
using Autofac;
using IdentityServer3.Core.Services;

namespace Affecto.AuthenticationServer.IdentityManagement
{
    public class IdentityManagementModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            base.Load(builder);

            builder.RegisterInstance(IdentityManagementConfiguration.Settings).As<IIdentityManagementConfiguration>();
            builder.RegisterType<UserService>().As<IUserService>();
            builder.RegisterModule<Affecto.IdentityManagement.Autofac.ModuleRegistration>();
            builder.RegisterModule<Affecto.IdentityManagement.Store.PostgreSql.ModuleRegistration>();

            builder.RegisterType<AuditTrailMock>().As<IAuditTrailService>();
        }
    }

    internal class AuditTrailMock : IAuditTrailService
    {
        public IEnumerable<IAuditTrailEntry> GetEntries()
        {
            return Enumerable.Empty<IAuditTrailEntry>();
        }

        public IAuditTrailResult GetEntries(IAuditTrailFilter filter)<commit_msg>Create IdentityManagementConfiguration only when needed.<commit_after>using System;
using System.Collections.Generic;
using System.Linq;
using Affecto.AuditTrail.Interfaces;
using Affecto.AuditTrail.Interfaces.Model;
using Affecto.AuthenticationServer.IdentityManagement.Configuration;
using Affecto.AuthenticationServer.Infrastructure.Configuration;
using Autofac;
using IdentityServer3.Core.Services;

namespace Affecto.AuthenticationServer.IdentityManagement
{
    public class IdentityManagementModule : Module
    {
        protected override void Load(ContainerBuilder builder)
        {
            base.Load(builder);

            builder.Register(CreateIdentityManagementConfiguration).SingleInstance().As<IIdentityManagementConfiguration>();
            builder.RegisterType<UserService>().As<IUserService>();
            builder.RegisterModule<Affecto.IdentityManagement.Autofac.ModuleRegistration>();
            builder.RegisterModule<Affecto.IdentityManagement.Store.PostgreSql.ModuleRegistration>();

            builder.RegisterType<AuditTrailMock>().As<IAuditTrailService>();
        }

        private static IIdentityManagementConfiguration CreateIdentityManagementConfiguration(IComponentContext arg)
        {
            return IdentityManagementConfiguration.Settings;
        }
    }

    internal class AuditTrailMock : IAuditTrailService
    {
        public IEnumerable<IAuditTrailEntry> GetEntries()
        {
            return Enumerable.Empty<IAuditTrailEntry>();
        }

        public IAuditTrailResult GetEntries(IAuditTrailFilter filter)
{'fraction_non_alphanumeric': 0.07822191592005513, 'fraction_numerical': 0.0006891798759476223, 'mean_word_length': 4.101933216168717, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '4742551', 'n_tokens_mistral': 718, 'n_tokens_neox': 710, 'n_words': 106}