<commit_before><?php

use Illuminate\Container\Container;
use Illuminate\Contracts\View\Factory as ViewFactory;

if (!function_exists('redact')) {
    /**
     * Redirect to action.
     *
     * @param string $name
     * @param array  $parameters
     * @param int    $status
     * @param array  $headers
     * @param bool   $secure
     *
     * @return Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
     */
    function redact($name, $parameters = [], $status = 302, $headers = [], $secure = null)
    {
        if (preg_match('/^_self@/', $name)) {
            $controller = explode('\\', strtok(Route::currentRouteAction(), '@'));

            $name = preg_replace('/^_self@/', end($controller).'@', $name);
        }

        $container = Container::getInstance();

        $action = $container->make('url')->action($name, $parameters);

        return $container->make('redirect')->to($action, $status, $headers, $secure);
    }
}

if (!function_exists('alert')) {
    /**
     * Alert view.
     *
     * @param string $type
     * @param string $message
     *
     * @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory
     */
    function alert($type, $message)
    {
        // Available alert types
        $alerts = [
            'info',
            'warning',
            'error',
            'success',
        ];

        if (!in_array($type, $alerts)) {
            return;
        }

        return app(ViewFactory::class)->make('cornerstone::alerts.'.$type, [
            'message' => $message,
        ]);
    }
}

if (!function_exists('is_active')) {
    /**
     * Returns the string "active" if the given Controller name or action matches the current Route. Useful for Views.
     *
     * @param string|array $needles
     * @param string|array $css_classes
     *
     * @return string
     */
    function is_active($needles, $css_classes = ['active'])
    {<commit_msg>Do not use helper function<commit_after><?php

use Illuminate\Container\Container;
use Illuminate\Contracts\View\Factory as ViewFactory;

if (!function_exists('redact')) {
    /**
     * Redirect to action.
     *
     * @param string $name
     * @param array  $parameters
     * @param int    $status
     * @param array  $headers
     * @param bool   $secure
     *
     * @return Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
     */
    function redact($name, $parameters = [], $status = 302, $headers = [], $secure = null)
    {
        if (preg_match('/^_self@/', $name)) {
            $controller = explode('\\', strtok(Route::currentRouteAction(), '@'));

            $name = preg_replace('/^_self@/', end($controller).'@', $name);
        }

        $container = Container::getInstance();

        $action = $container->make('url')->action($name, $parameters);

        return $container->make('redirect')->to($action, $status, $headers, $secure);
    }
}

if (!function_exists('alert')) {
    /**
     * Alert view.
     *
     * @param string $type
     * @param string $message
     *
     * @return \Illuminate\View\View|\Illuminate\Contracts\View\Factory
     */
    function alert($type, $message)
    {
        // Available alert types
        $alerts = [
            'info',
            'warning',
            'error',
            'success',
        ];

        if (!in_array($type, $alerts)) {
            return;
        }

        $container = Container::getInstance();

        return $container->make(ViewFactory::class)->make('cornerstone::alerts.'.$type, [
            'message' => $message,
        ]);
    }
}

if (!function_exists('is_active')) {
    /**
     * Returns the string "active" if the given Controller name or action matches the current Route. Useful for Views.
     *
     * @param string|array $needles
     * @param string|array $css_classes
     *
     * @return string
     */
    function is_active($needles, $css_classes = ['active'])
    {
{'fraction_non_alphanumeric': 0.15955284552845528, 'fraction_numerical': 0.001524390243902439, 'mean_word_length': 2.259105960264901, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '1949182', 'n_tokens_mistral': 1150, 'n_tokens_neox': 1154, 'n_words': 246}