<commit_before>﻿//----------------------------------------------------------------------------------------------
// <copyright file="Program.cs" company="Microsoft Corporation">
//     Licensed under the MIT License. See LICENSE.TXT in the project root license information.
// </copyright>
//----------------------------------------------------------------------------------------------

using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Tools.WindowsDevicePortal;
using static Microsoft.Tools.WindowsDevicePortal.DevicePortal;

namespace TestApp
{
    /// <summary>
    /// Application class.
    /// </summary>
    internal class Program : IDisposable
    {
        /// <summary>
        /// The IP address of the device.
        /// </summary>
        private string ipAddress = null;

        /// <summary>
        /// The user name used when connecting to the device.
        /// </summary>
        private string userName = null;

        /// <summary>
        /// The password used when connecting to the device.
        /// </summary>
        private string password = <PASSWORD>;

        /// <summary>
        /// The network access point to which the device should be connected.
        /// </summary>
        private string ssid = null;

        /// <summary>
        /// The security key to use when connecting to the network access point.
        /// </summary>
        private string key = null;

        /// <summary>
        /// Event used to indicate that the connection process is complete.
        /// </summary>
        private ManualResetEvent mreConnected = new ManualResetEvent(false);

        /// <summary>
        /// Event used to indicate that the application install process is complete.
        /// </summary>
        private ManualResetEvent mreAppInstall = new ManualResetEvent(false);

        /// <summary>
        /// The application entry point.
        /// </summary>
        /// <param name="args">Array of command line arguments.</param>
        public static void Main(string[] args)
        {
            Program app = new Program();

            try
            {
                app.ParseCommandLine(args);
            }
            catch (Exception e)
            {
                // TODO: Make a usage display
                Console.WriteLine(e.Message);
                return;
            }

            DevicePortal portal = new DevicePortal(new DevicePortalConnection(app.ipAddress, app.userName, app.password));
            portal.ConnectionStatus += app.ConnectionStatusHandler;
            portal.AppInstallStatus += app.AppInstallStatusHandler;

            app.mreConnected.Reset();
            Console.WriteLine("Connecting...");
            Task t = portal.Connect(app.ssid, app.key);
            app.mreConnected.WaitOne();

            Console.WriteLine("Connected to: " + portal.Address);
            Console.WriteLine("OS version: " + portal.OperatingSystemVersion);
            Console.WriteLine("Device family: " + portal.DeviceFamily);
////            Console.WriteLine("Device name: " + portal.GetDeviceName)
            Console.WriteLine("Platform: " + portal.Platform.ToString());

            Task<string> getNameTask = portal.GetDeviceName();
            getNameTask.Wait();

            Task<float> getIpdTask = portal.GetInterPupilaryDistance();
            getIpdTask.Wait();
            Console.WriteLine("IPD: " + getIpdTask.Result.ToString());

            Task<BatteryState> batteryTask = portal.GetBatteryState();
            batteryTask.Wait();
            Console.WriteLine("Battery level: " + batteryTask.Result.Level);

            Task<PowerState> powerTask = portal.GetPowerState();
            powerTask.Wait();
            Console.WriteLine("In low power state: " + powerTask.Result.InLowPowerState);

            Task<Guid> activeSchemeTask = portal.GetActivePowerScheme();
            activeSchemeTask.Wait();
            Console.WriteLine("Active power scheme id: " + activeSchemeTask.Result.ToString());

            Task<MrcFileList> fileListTask = portal.GetMrcFileList();
            fileListTask.Wait();
            MrcFileList mrcFileList = fileListTask.Result;
            Console.WriteLine(string.Format("Found {0} MRC files on your device", mrcFileList.Files.Count));
            foreach (MrcFileInformation fileInfo in mrcFileList.Files)
            {
                Console.WriteLine(string.Format("{0} : {1} {2} bytes", fileInfo.FileName, fileInfo.Created, fileInfo.FileSize));

                //// TODO: Save the thumbnail
                //// TODO: Download / save the file

                Task deleteTask = portal.DeleteMrcFile(fileInfo.FileName);
                deleteTask.Wait();
            }

            while (true)
            {
                System.Threading.Thread.Sleep(0);
            }
        }

        /// <summary>
        /// Cleans up the object's data.
        /// </summary>
        public void Dispose()
        {<commit_msg>missed removing one block of mrc related code<commit_after>﻿//----------------------------------------------------------------------------------------------
// <copyright file="Program.cs" company="Microsoft Corporation">
//     Licensed under the MIT License. See LICENSE.TXT in the project root license information.
// </copyright>
//----------------------------------------------------------------------------------------------

using System;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Tools.WindowsDevicePortal;
using static Microsoft.Tools.WindowsDevicePortal.DevicePortal;

namespace TestApp
{
    /// <summary>
    /// Application class.
    /// </summary>
    internal class Program : IDisposable
    {
        /// <summary>
        /// The IP address of the device.
        /// </summary>
        private string ipAddress = null;

        /// <summary>
        /// The user name used when connecting to the device.
        /// </summary>
        private string userName = null;

        /// <summary>
        /// The password used when connecting to the device.
        /// </summary>
        private string password = <PASSWORD>;

        /// <summary>
        /// The network access point to which the device should be connected.
        /// </summary>
        private string ssid = null;

        /// <summary>
        /// The security key to use when connecting to the network access point.
        /// </summary>
        private string key = null;

        /// <summary>
        /// Event used to indicate that the connection process is complete.
        /// </summary>
        private ManualResetEvent mreConnected = new ManualResetEvent(false);

        /// <summary>
        /// Event used to indicate that the application install process is complete.
        /// </summary>
        private ManualResetEvent mreAppInstall = new ManualResetEvent(false);

        /// <summary>
        /// The application entry point.
        /// </summary>
        /// <param name="args">Array of command line arguments.</param>
        public static void Main(string[] args)
        {
            Program app = new Program();

            try
            {
                app.ParseCommandLine(args);
            }
            catch (Exception e)
            {
                // TODO: Make a usage display
                Console.WriteLine(e.Message);
                return;
            }

            DevicePortal portal = new DevicePortal(new DevicePortalConnection(app.ipAddress, app.userName, app.password));
            portal.ConnectionStatus += app.ConnectionStatusHandler;
            portal.AppInstallStatus += app.AppInstallStatusHandler;

            app.mreConnected.Reset();
            Console.WriteLine("Connecting...");
            Task t = portal.Connect(app.ssid, app.key);
            app.mreConnected.WaitOne();

            Console.WriteLine("Connected to: " + portal.Address);
            Console.WriteLine("OS version: " + portal.OperatingSystemVersion);
            Console.WriteLine("Device family: " + portal.DeviceFamily);
////            Console.WriteLine("Device name: " + portal.GetDeviceName)
            Console.WriteLine("Platform: " + portal.Platform.ToString());

            Task<string> getNameTask = portal.GetDeviceName();
            getNameTask.Wait();

            Task<float> getIpdTask = portal.GetInterPupilaryDistance();
            getIpdTask.Wait();
            Console.WriteLine("IPD: " + getIpdTask.Result.ToString());

            Task<BatteryState> batteryTask = portal.GetBatteryState();
            batteryTask.Wait();
            Console.WriteLine("Battery level: " + batteryTask.Result.Level);

            Task<PowerState> powerTask = portal.GetPowerState();
            powerTask.Wait();
            Console.WriteLine("In low power state: " + powerTask.Result.InLowPowerState);

            Task<Guid> activeSchemeTask = portal.GetActivePowerScheme();
            activeSchemeTask.Wait();
            Console.WriteLine("Active power scheme id: " + activeSchemeTask.Result.ToString());

            while (true)
            {
                System.Threading.Thread.Sleep(0);
            }
        }

        /// <summary>
        /// Cleans up the object's data.
        /// </summary>
        public void Dispose()
        {
{'fraction_non_alphanumeric': 0.14918314703353397, 'fraction_numerical': 0.0006448839208942391, 'mean_word_length': 1.6807836358398156, 'pattern_counts': {'":': 0, '<': 64, '<?xml version=': 0, '>': 64, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6030304', 'n_tokens_mistral': 2216, 'n_tokens_neox': 2157, 'n_words': 575}