<commit_before>﻿using System;
using Windows.Devices.Gpio;

namespace Wicip
{
	public class Led
	{
		GpioPin pin;

		public Led( int pinId )
		{
			GpioController controller = GpioController.GetDefault();
			this.pin = controller.OpenPin( pinId );
			this.pin.Write( GpioPinValue.High );
			this.pin.SetDriveMode( GpioPinDriveMode.Output );
		}


		public void TurnOn()
		{
			this.pin.Write( GpioPinValue.Low );
		}


		public void TurnOff()
		{
			this.pin.Write( GpioPinValue.High );
		}
	}<commit_msg>ADDED: The Led class implements the IDisposable interface to ensure that the GPIO pin is properly closed.<commit_after>﻿using System;
using Windows.Devices.Gpio;

namespace Wicip
{
	public sealed class Led : IDisposable
	{
		GpioPin pin;

		public Led( int pinId )
		{
			GpioController controller = GpioController.GetDefault();
			this.pin = controller.OpenPin( pinId );
			this.pin.Write( GpioPinValue.High );
			this.pin.SetDriveMode( GpioPinDriveMode.Output );
		}

		public void Dispose()
		{
			if( this.pin != null )
			{
				this.pin.Dispose();
			}
		}


		public void TurnOn()
		{
			this.pin.Write( GpioPinValue.Low );
		}


		public void TurnOff()
		{
			this.pin.Write( GpioPinValue.High );
		}

	}
{'fraction_non_alphanumeric': 0.11275720164609053, 'fraction_numerical': 0.0, 'mean_word_length': 3.2222222222222223, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3785417', 'n_tokens_mistral': 496, 'n_tokens_neox': 440, 'n_words': 95}