<commit_before>﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.IO;
using Xemio.GameLibrary.Events;
using Xemio.GameLibrary.Events.Logging;

namespace Xemio.GameLibrary.Plugins.Contexts
{
    internal class FileAssemblyContext : IAssemblyContext
    {
        #region Fields
        private readonly HashSet<Assembly> _assemblies;
        #endregion Fields

        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="FileAssemblyContext"/> class.
        /// </summary>
        /// <param name="directory">The directory.</param>
        public FileAssemblyContext(string directory)
        {
            this._assemblies = new HashSet<Assembly>();
            this.LoadAssemblies(directory);
        }
        #endregion
        
        #region Methods
        /// <summary>
        /// Loads the assemblies out of the specified path.
        /// </summary>
        /// <param name="directory">The directory.</param>
        private void LoadAssemblies(string directory)
        {
            var eventManager = XGL.Components.Get<EventManager>();

            foreach (string fileName in Directory.GetFiles(directory))
            {
                if (Path.GetExtension(fileName) == ".dll" ||
                    Path.GetExtension(fileName) == ".exe")
                {
                    try
                    {
                        this._assemblies.Add(Assembly.LoadFrom(fileName));
                    }
                    catch (Exception exception)
                    {
                        eventManager.Publish(new ExceptionEvent(exception));
                    }
                }
            }

            foreach (string subDirectory in Directory.GetDirectories(directory))
            {
                this.LoadAssemblies(subDirectory);
            }
        }
        #endregion

        #region Implementation of IAssemblyContext
        /// <summary>
        /// Gets the assemblies.
        /// </summary>
        public IEnumerable<Assembly> Assemblies
        {
            get { return this._assemblies; }
        }
        #endregion
    }
}<commit_msg>Inverted an if clause.<commit_after>﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.IO;
using Xemio.GameLibrary.Events;
using Xemio.GameLibrary.Events.Logging;

namespace Xemio.GameLibrary.Plugins.Contexts
{
    internal class FileAssemblyContext : IAssemblyContext
    {
        #region Fields
        private readonly HashSet<Assembly> _assemblies;
        #endregion Fields

        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="FileAssemblyContext"/> class.
        /// </summary>
        /// <param name="directory">The directory.</param>
        public FileAssemblyContext(string directory)
        {
            this._assemblies = new HashSet<Assembly>();
            this.LoadAssemblies(directory);
        }
        #endregion
        
        #region Methods
        /// <summary>
        /// Loads the assemblies out of the specified path.
        /// </summary>
        /// <param name="directory">The directory.</param>
        private void LoadAssemblies(string directory)
        {
            var eventManager = XGL.Components.Get<EventManager>();

            foreach (string fileName in Directory.GetFiles(directory))
            {
                if (Path.GetExtension(fileName) != ".dll" && Path.GetExtension(fileName) != ".exe")
                    continue;

                try
                {
                    this._assemblies.Add(Assembly.LoadFrom(fileName));
                }
                catch (Exception exception)
                {
                    eventManager.Publish(new ExceptionEvent(exception));
                }
            }

            foreach (string subDirectory in Directory.GetDirectories(directory))
            {
                this.LoadAssemblies(subDirectory);
            }
        }
        #endregion

        #region Implementation of IAssemblyContext
        /// <summary>
        /// Gets the assemblies.
        /// </summary>
        public IEnumerable<Assembly> Assemblies
        {
            get { return this._assemblies; }
        }
        #endregion
    }
}
{'fraction_non_alphanumeric': 0.0965391621129326, 'fraction_numerical': 0.0, 'mean_word_length': 1.6511768255884127, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '4154733', 'n_tokens_mistral': 1084, 'n_tokens_neox': 1043, 'n_words': 236}