<commit_before><?php

if (! function_exists('container')) {
    /**
     * Returns the available container instance.
     *
     * @param  string $key
     * @return mixed
     */
    function container($key = null)
    {
        $container = Rougin\Slytherin\Application::container();

        return (is_null($key)) ? $container : $container->get($key);
    }
}

if (! function_exists('config')) {
    /**
     * Gets the configuration from the specified file.
     *
     * @param  string|null $key
     * @param  string|null $default
     * @return mixed
     */
    function config($key = null, $default = null)
    {
        $class = 'Rougin\Slytherin\Integration\Configuration';

        $config = container($class);

        return (! $key) ? $config : $config->get($key, $default);
    }
}

if (! function_exists('path')) {
    /**
     * Returns the base path of the application.
     *
     * @param  string|null $item
     * @return string
     */
    function path($item = null)
    {
        $item = str_replace([ '\\', '/' ], DIRECTORY_SEPARATOR, $item);

        return str_replace('src', '', __DIR__) . $item;
    }
}

if (! function_exists('redirect')) {
    /**
     * Returns a redirect response.
     *
     * @param  string $url
     * @return \Psr\Http\Message\ResponseInterface
     */
    function redirect($url)
    {
        return response(302)->withHeader('Location', $url);
    }
}

if (! function_exists('request')) {
    /**<commit_msg>Update HelperCollection<commit_after><?php

if (! function_exists('container')) {
    /**
     * Returns the available container instance.
     *
     * @param  string $key
     * @return mixed
     */
    function container($key = null)
    {
        $container = Rougin\Slytherin\Application::container();

        return (is_null($key)) ? $container : $container->get($key);
    }
}

if (! function_exists('config')) {
    /**
     * Gets the configuration from the specified file.
     *
     * @param  string|null $key
     * @param  string|null $default
     * @return mixed
     */
    function config($key = null, $default = null)
    {
        $class = 'Rougin\Slytherin\Integration\Configuration';

        $config = container($class);

        return (! $key) ? $config : $config->get($key, $default);
    }
}

if (! function_exists('path')) {
    /**
     * Returns the base path of the application.
     *
     * @param  string|null $item
     * @return string
     */
    function path($item = null)
    {
        $item = str_replace([ '\\', '/' ], DIRECTORY_SEPARATOR, $item);

        return str_replace('src', '', __DIR__) . $item;
    }
}

if (! function_exists('redirect')) {
    /**
     * Returns a redirect response.
     *
     * @param  string $url
     * @return \Psr\Http\Message\ResponseInterface
     */
    function redirect($url)
    {
        $url = $url[0] !== '/' ? '/' . $url : (string) $url;

        return response(302)->withHeader('Location', $url);
    }
}

if (! function_exists('request')) {
    /**
{'fraction_non_alphanumeric': 0.16289893617021275, 'fraction_numerical': 0.002327127659574468, 'mean_word_length': 2.313876651982379, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1326195', 'n_tokens_mistral': 929, 'n_tokens_neox': 917, 'n_words': 198}