<commit_before>using System;
using System.Collections.Generic;
using System.Diagnostics;

namespace IISExpressBootstrapper
{
    internal class ProcessRunner : IDisposable
    {
        private readonly ProcessStartInfo processStartInfo;
        private Process process;

        public static ProcessRunner Run(string exePath, string arguments = "", IDictionary<string, string> environmentVariables = null)
        {
            var processRunner = new ProcessRunner(exePath, arguments, environmentVariables);
            processRunner.Start();

            return processRunner;
        }

        private ProcessRunner(string exePath, string arguments, IEnumerable<KeyValuePair<string, string>> environmentVariables)
        {
            processStartInfo = new ProcessStartInfo(exePath)
            {
                Arguments = arguments,
                LoadUserProfile = false,
                UseShellExecute = false
            };
            
            if (environmentVariables == null) return;
            
            foreach (var environmentVariable in environmentVariables)
            {
                processStartInfo.EnvironmentVariables.Add(environmentVariable.Key, environmentVariable.Value);
            }
        }

        public void Start()
        {
            process = Process.Start(processStartInfo);
        }

        public void Dispose()
        {
            if (process == null) return;

            process.Kill();
        }
    }
}
<commit_msg>Added check to determine if iis express is still running before attempting to kill it.<commit_after>using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

namespace IISExpressBootstrapper
{
    internal class ProcessRunner : IDisposable
    {
        private readonly ProcessStartInfo processStartInfo;
        private Process process;

        public static ProcessRunner Run(string exePath, string arguments = "", IDictionary<string, string> environmentVariables = null)
        {
            var processRunner = new ProcessRunner(exePath, arguments, environmentVariables);
            processRunner.Start();

            return processRunner;
        }

        private ProcessRunner(string exePath, string arguments, IEnumerable<KeyValuePair<string, string>> environmentVariables)
        {
            processStartInfo = new ProcessStartInfo(exePath)
            {
                Arguments = arguments,
                LoadUserProfile = false,
                UseShellExecute = false
            };
            
            if (environmentVariables == null) return;
            
            foreach (var environmentVariable in environmentVariables)
            {
                processStartInfo.EnvironmentVariables.Add(environmentVariable.Key, environmentVariable.Value);
            }
        }

        public void Start()
        {
            process = Process.Start(processStartInfo);
        }

        public void Dispose()
        {
            if (process == null || !Process.GetProcesses().Any(x => x.Id == process.Id)) return;

            process.Kill();
        }
    }
}

{'fraction_non_alphanumeric': 0.07060333761232349, 'fraction_numerical': 0.0, 'mean_word_length': 2.058881256133464, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, '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': '1358891', 'n_tokens_mistral': 709, 'n_tokens_neox': 679, 'n_words': 179}