<commit_before>#region License

// 
//  Copyright 2012 <NAME>
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// 

#endregion
using System;
using System.Linq;

namespace Nova.Threading
{
    /// <summary>
    /// ActionFlags Extensions.
    /// </summary>
    internal static class ActionFlagsExtensions
    {
        /// <summary>
        /// Checks the flags.
        /// </summary>
        /// <param name="flags">The flags.</param>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public static bool CheckFlags(this ActionFlags flags, ActionFlags value)
        {
            return (flags & value) == value;
        }

        /// <summary>
        /// Checks the flags using an OR operator.
        /// </summary>
        /// <param name="flags">The flags.</param>
        /// <param name="values">The values.</param>
        /// <returns></returns>
        public static bool CheckFlags(this ActionFlags flags, params ActionFlags[] values)
        {
            return values.Any(x => flags.CheckFlags(x));
        }
    }

    /// <summary>
    /// Flags to define special behaviour to an action.
    /// </summary>
    [Flags]
    public enum ActionFlags
    {
        /// <summary>
        /// No special action defined.
        /// </summary>
        None = 1 << 0,

        /// <summary>
        /// A queue will be created if necessairy.
        /// </summary>
        EnterStep = 1 << 1,

        /// <summary>
        /// The queue will be terminated after finishing this task. This is also blocking per definition.
        /// </summary>
        LeaveStep = 1 << 2,

        /// <summary>
        /// A blocking action. New actions won't be queued until this action has finished executing.
        /// </summary>
        Blocking = 1 << 3
    }
}<commit_msg>Better way to make a LeaveStep Blocking<commit_after>#region License

// 
//  Copyright 2012 <NAME>
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// 

#endregion
using System;
using System.Linq;

namespace Nova.Threading
{
    /// <summary>
    /// ActionFlags Extensions.
    /// </summary>
    internal static class ActionFlagsExtensions
    {
        /// <summary>
        /// Checks the flags.
        /// </summary>
        /// <param name="flags">The flags.</param>
        /// <param name="value">The value.</param>
        /// <returns></returns>
        public static bool CheckFlags(this ActionFlags flags, ActionFlags value)
        {
            return (flags & value) == value;
        }

        /// <summary>
        /// Checks the flags using an OR operator.
        /// </summary>
        /// <param name="flags">The flags.</param>
        /// <param name="values">The values.</param>
        /// <returns></returns>
        public static bool CheckFlags(this ActionFlags flags, params ActionFlags[] values)
        {
            return values.Any(x => flags.CheckFlags(x));
        }
    }

    /// <summary>
    /// Flags to define special behaviour to an action.
    /// </summary>
    [Flags]
    public enum ActionFlags
    {
        /// <summary>
        /// No special action defined.
        /// </summary>
        None = 1 << 0,

        /// <summary>
        /// A queue will be created if necessairy.
        /// </summary>
        EnterStep = 1 << 1,

        /// <summary>
        /// The queue will be terminated after finishing this task. This is also blocking per definition.
        /// </summary>
        LeaveStep = 1 << 2 | Blocking,

        /// <summary>
        /// A blocking action. New actions won't be queued until this action has finished executing.
        /// </summary>
        Blocking = 1 << 3
    }
}
{'fraction_non_alphanumeric': 0.1290804352464263, 'fraction_numerical': 0.006827394922125027, 'mean_word_length': 1.8602806589383771, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3924278', 'n_tokens_mistral': 1239, 'n_tokens_neox': 1198, 'n_words': 455}