<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace Puenktlich
{
    /// <summary>
    ///     The puenktlich scheduler. Pünktlich means punctual in German. Nur echt mit den Umlauten!
    /// </summary>
    public class Scheduler : IDisposable
    {
        private readonly Dictionary<object, IJobRegistration<object>> _jobs =
            new Dictionary<object, IJobRegistration<object>>();

        private readonly object _jobsLock = new object();

        private ManualResetEventSlim _running = new ManualResetEventSlim();

        /// <summary>
        ///     Initializes a new instance of the <see cref="Scheduler" /> class.
        /// </summary>
        public Scheduler() : this(() => DateTimeOffset.UtcNow)
        {
        }

        /// <summary>
        ///     Initializes a new instance of the <see cref="Scheduler" /> class.
        /// </summary>
        public Scheduler(Func<DateTimeOffset> clock)
        {
            Clock = clock;
        }

        /// <summary>
        ///     Gets or sets the clock. The clock is a function that should return an UTC timestamp.
        ///     This property allows easy dependency injection and defaults to a function returning
        ///     <see cref="DateTimeOffset.UtcNow" />.
        /// </summary>
        /// <value>The function returning a timestamp.</value>
        public Func<DateTimeOffset> Clock { get; set; }
<commit_msg>Added IsRunning<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

namespace Puenktlich
{
    /// <summary>
    ///     The puenktlich scheduler. Pünktlich means punctual in German. Nur echt mit den Umlauten!
    /// </summary>
    public class Scheduler : IDisposable
    {
        private readonly Dictionary<object, IJobRegistration<object>> _jobs =
            new Dictionary<object, IJobRegistration<object>>();

        private readonly object _jobsLock = new object();

        private ManualResetEventSlim _running = new ManualResetEventSlim();

        /// <summary>
        ///     Initializes a new instance of the <see cref="Scheduler" /> class.
        /// </summary>
        public Scheduler() : this(() => DateTimeOffset.UtcNow)
        {
        }

        /// <summary>
        ///     Initializes a new instance of the <see cref="Scheduler" /> class.
        /// </summary>
        public Scheduler(Func<DateTimeOffset> clock)
        {
            Clock = clock;
        }

        /// <summary>
        ///     Gets or sets the clock. The clock is a function that should return an UTC timestamp.
        ///     This property allows easy dependency injection and defaults to a function returning
        ///     <see cref="DateTimeOffset.UtcNow" />.
        /// </summary>
        /// <value>The function returning a timestamp.</value>
        public Func<DateTimeOffset> Clock { get; set; }

        public bool IsRunning
        {
            get { return _running.IsSet; }
        }

{'fraction_non_alphanumeric': 0.10823071937783539, 'fraction_numerical': 0.0, 'mean_word_length': 2.087, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 43, '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': '6017292', 'n_tokens_mistral': 810, 'n_tokens_neox': 794, 'n_words': 253}