<commit_before><?php

/*
 * This file is part of the Symfony package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Console\Output;

/**
 * Base class for output classes.
 *
 * There is three level of verbosity:
 *
 *  * normal: no option passed (normal output - information)
 *  * verbose: -v (more output - debug)
 *  * quiet: -q (no output)
 *
 * @author <NAME> <<EMAIL>>
 */
abstract class Output implements OutputInterface
{
    const VERBOSITY_QUIET   = 0;
    const VERBOSITY_NORMAL  = 1;
    const VERBOSITY_VERBOSE = 2;

    const OUTPUT_NORMAL = 0;
    const OUTPUT_RAW = 1;
    const OUTPUT_PLAIN = 2;

    protected $verbosity;
    protected $decorated;

    static private $styles = array(
        'error'    => array('bg' => 'red', 'fg' => 'white'),
        'info'     => array('fg' => 'green'),
        'comment'  => array('fg' => 'yellow'),
        'question' => array('bg' => 'cyan', 'fg' => 'black'),
    );
    static private $options    = array('bold' => 1, 'underscore' => 4, 'blink' => 5, 'reverse' => 7, 'conceal' => 8);
    static private $foreground = array('black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37);
    static private $background = array('black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47);

    /**
     * Constructor.
     *
     * @param integer $verbosity The verbosity level (self::VERBOSITY_QUIET, self::VERBOSITY_NORMAL, self::VERBOSITY_VERBOSE)
     * @param Boolean $decorated Whether to decorate messages or not (null for auto-guessing)
     */
    public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null)
    {
        $this->decorated = (Boolean) $decorated;
        $this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity;
    }

    /**
     * Sets a new style.
     *
     * @param string $name    The style name
     * @param array  $options An array of options
     */
    static public function setStyle($name, $options = array())
    {
        self::$styles[strtolower($name)] = $options;
    }

    /**
     * Sets the decorated flag.
     *
     * @param Boolean $decorated Whether to decorated the messages or not
     */
    public function setDecorated($decorated)
    {
        $this->decorated = (Boolean) $decorated;
    }

    /**<commit_msg>we need ability to get style parameters same way we set them with setStyle<commit_after><?php

/*
 * This file is part of the Symfony package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Console\Output;

/**
 * Base class for output classes.
 *
 * There is three level of verbosity:
 *
 *  * normal: no option passed (normal output - information)
 *  * verbose: -v (more output - debug)
 *  * quiet: -q (no output)
 *
 * @author <NAME> <<EMAIL>>
 */
abstract class Output implements OutputInterface
{
    const VERBOSITY_QUIET   = 0;
    const VERBOSITY_NORMAL  = 1;
    const VERBOSITY_VERBOSE = 2;

    const OUTPUT_NORMAL = 0;
    const OUTPUT_RAW = 1;
    const OUTPUT_PLAIN = 2;

    protected $verbosity;
    protected $decorated;

    static private $styles = array(
        'error'    => array('bg' => 'red', 'fg' => 'white'),
        'info'     => array('fg' => 'green'),
        'comment'  => array('fg' => 'yellow'),
        'question' => array('bg' => 'cyan', 'fg' => 'black'),
    );
    static private $options    = array('bold' => 1, 'underscore' => 4, 'blink' => 5, 'reverse' => 7, 'conceal' => 8);
    static private $foreground = array('black' => 30, 'red' => 31, 'green' => 32, 'yellow' => 33, 'blue' => 34, 'magenta' => 35, 'cyan' => 36, 'white' => 37);
    static private $background = array('black' => 40, 'red' => 41, 'green' => 42, 'yellow' => 43, 'blue' => 44, 'magenta' => 45, 'cyan' => 46, 'white' => 47);

    /**
     * Constructor.
     *
     * @param integer $verbosity The verbosity level (self::VERBOSITY_QUIET, self::VERBOSITY_NORMAL, self::VERBOSITY_VERBOSE)
     * @param Boolean $decorated Whether to decorate messages or not (null for auto-guessing)
     */
    public function __construct($verbosity = self::VERBOSITY_NORMAL, $decorated = null)
    {
        $this->decorated = (Boolean) $decorated;
        $this->verbosity = null === $verbosity ? self::VERBOSITY_NORMAL : $verbosity;
    }

    /**
     * Sets a new style.
     *
     * @param string $name    The style name
     * @param array  $options An array of options
     */
    static public function setStyle($name, $options = array())
    {
        self::$styles[strtolower($name)] = $options;
    }

    /**
     * Gets style options from style with specified name.
     *
     * @param   string  $name
     *
     * @return  array
     */
    static public function getStyle($name)
    {
        if (!isset(self::$styles[strtolower($name)])) {
            throw new \InvalidArgumentException('Undefined style: ' . $name);
        }

        return self::$styles[strtolower($name)];
    }

    /**
     * Sets the decorated flag.
     *
     * @param Boolean $decorated Whether to decorated the messages or not
     */
    public function setDecorated($decorated)
    {
        $this->decorated = (Boolean) $decorated;
    }

    /**
{'fraction_non_alphanumeric': 0.15298169294906652, 'fraction_numerical': 0.015588181982961755, 'mean_word_length': 2.784636488340192, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 83, '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': '1499416', 'n_tokens_mistral': 1855, 'n_tokens_neox': 1756, 'n_words': 523}