<commit_before>﻿using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Xml;
using NuGet;

namespace Bootstrapper
{
    public class Program
    {
        public static int Main(string[] args)
        {
            string exePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"NuGet\NuGet.exe");
            try
            {
                var processInfo = new ProcessStartInfo(exePath)
                {
                    UseShellExecute = false,
                    WorkingDirectory = Environment.CurrentDirectory
                };

                if (!File.Exists(exePath))
                {
                    var document = GetConfigDocument();
                    EnsurePackageRestoreConsent(document);
                    ProxyCache.Instance = new ProxyCache(document);
                    if (!Directory.Exists(exePath))
                    {
                        Directory.CreateDirectory(exePath);
                    }

                    DownloadExe(exePath);
                }
                else if ((DateTime.UtcNow - File.GetLastWriteTimeUtc(exePath)).TotalDays > 10)
                {
                    // Check for updates to the exe every 10 days
                    processInfo.Arguments = "update -self";
                    RunProcess(processInfo);
                    File.SetLastWriteTimeUtc(exePath, DateTime.UtcNow);
                }
                processInfo.Arguments = ParseArgs();
                return RunProcess(processInfo);
            }
            catch (Exception e)
            {
                WriteError(e);<commit_msg>Fix 'nuget.exe' folder creation (sometimes locks the filename and is unable to overwrite/download)<commit_after>﻿using System;
using System.Diagnostics;
using System.IO;
using System.Threading;
using System.Xml;
using NuGet;

namespace Bootstrapper
{
    public class Program
    {
        public static int Main(string[] args)
        {
            string exePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"NuGet\NuGet.exe");
            try
            {
                var processInfo = new ProcessStartInfo(exePath)
                {
                    UseShellExecute = false,
                    WorkingDirectory = Environment.CurrentDirectory
                };

                if (!File.Exists(exePath))
                {
                    var document = GetConfigDocument();
                    EnsurePackageRestoreConsent(document);
                    ProxyCache.Instance = new ProxyCache(document);
                    if (!Directory.Exists(Path.GetDirectoryName(exePath)))
                    {
                        Directory.CreateDirectory(Path.GetDirectoryName(exePath));
                    }

                    DownloadExe(exePath);
                }
                else if ((DateTime.UtcNow - File.GetLastWriteTimeUtc(exePath)).TotalDays > 10)
                {
                    // Check for updates to the exe every 10 days
                    processInfo.Arguments = "update -self";
                    RunProcess(processInfo);
                    File.SetLastWriteTimeUtc(exePath, DateTime.UtcNow);
                }
                processInfo.Arguments = ParseArgs();
                return RunProcess(processInfo);
            }
            catch (Exception e)
            {
                WriteError(e);
{'fraction_non_alphanumeric': 0.07756874095513748, 'fraction_numerical': 0.0023154848046309695, 'mean_word_length': 1.4355179704016914, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1863215', 'n_tokens_mistral': 855, 'n_tokens_neox': 766, 'n_words': 163}