<commit_before>package edu.flash3388.flashlib.robot.scheduling.actions;

import edu.flash3388.flashlib.robot.scheduling.Action;

public class Actions {

    private Actions() {}

    /**
     * Creates an action which does nothing.
     *
     * @return an empty action.
     */
    public static Action empty() {
        return new Action() {
            @Override
            protected void execute() {
            }

            @Override
            protected void end() {
            }
        };
    }

    /**
     * Creates a canceling action for an action. This is an {@link InstantAction} which calls {@link Action#cancel()}
     * for a given action when started.
     *
     * @param action action to cancel
     * @return canceling action
     */
    public static Action stopAction(Action action){
        return new InstantAction(){
            @Override
            public void execute() {
                if(action.isRunning())
                    action.cancel();
            }
        };
    }
}<commit_msg>actions util newinstantaction from runnable<commit_after>package edu.flash3388.flashlib.robot.scheduling.actions;

import edu.flash3388.flashlib.robot.scheduling.Action;

public class Actions {

    private Actions() {}

    /**
     * Creates an action which does nothing.
     *
     * @return an empty action.
     */
    public static Action empty() {
        return new Action() {
            @Override
            protected void execute() {
            }

            @Override
            protected void end() {
            }
        };
    }

    /**
     * Creates a canceling action for an action. This is an {@link InstantAction} which calls {@link Action#cancel()}
     * for a given action when started.
     *
     * @param action action to cancel
     * @return canceling action
     */
    public static Action stopAction(Action action){
        return new InstantAction(){
            @Override
            public void execute() {
                if(action.isRunning())
                    action.cancel();
            }
        };
    }

    public static Action instantAction(Runnable runnable) {
        return new InstantAction() {
            @Override
            protected void execute() {
                runnable.run();
            }
        };
    }
}
{'fraction_non_alphanumeric': 0.0920138888888889, 'fraction_numerical': 0.006944444444444444, 'mean_word_length': 1.6494252873563218, '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': '537673', 'n_tokens_mistral': 609, 'n_tokens_neox': 571, 'n_words': 173}