<commit_before>const assert = require('assert');
const EventEmitter = require('events');
const TypeCheck = require('js-typecheck');
const minimatch = require('minimatch');
const Session = require('./Session');
const Action = require('./Action');
const Reader = require('./Reader');
const Writer = require('./Writer');
const Util = require('./Util');

// symbols used for private instance variables to avoid any potential clashing
// caused by re-implementations
const _session = Symbol('session');
const _metadata = Symbol('metadata');


/**
 * A handler is used to bridge an execution method to Oca.
 *
 * The data used by the handler is parsed through a {@link Reader}. This data
 * is then loaded to the action during the execution time through
 * {@link Handler.execute}.
 *
 * The result of a handler is done through a {@link Writer}. Writers are designed
 * to support reporting a success output and an error output as well. The way the
 * result is serialized is determined by a writer implementation
 * ({@link Writer._successOutput}, {@link Writer._errorOutput}). All writers
 * shipped with Oca have support for streams where in case of any readable stream<commit_msg>improved handler documentation<commit_after>const assert = require('assert');
const EventEmitter = require('events');
const TypeCheck = require('js-typecheck');
const minimatch = require('minimatch');
const Session = require('./Session');
const Action = require('./Action');
const Reader = require('./Reader');
const Writer = require('./Writer');
const Util = require('./Util');

// symbols used for private instance variables to avoid any potential clashing
// caused by re-implementations
const _session = Symbol('session');
const _metadata = Symbol('metadata');


/**
 * A handler is used to bridge an execution method to Oca.
 *
 * The data used by the handler is parsed through a {@link Reader}. This data
 * is then loaded to the action during the execution time through
 * {@link Handler.execute}.
 *
 * The result of a handler is done through a {@link Writer}. Writers are designed
 * to support reporting a success output and an error output as well. The way the
 * result is serialized is determined by the writer implementation
 * ({@link Writer._successOutput}, {@link Writer._errorOutput}). All writers
 * shipped with Oca have support for streams where in case of any readable stream
{'fraction_non_alphanumeric': 0.10610526315789473, 'fraction_numerical': 0.0, 'mean_word_length': 4.697841726618705, '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': '4575378', 'n_tokens_mistral': 561, 'n_tokens_neox': 551, 'n_words': 287}