<commit_before><?php namespace Orchestra\Html\Table;

use Illuminate\Support\Arr;
use Illuminate\Http\Request;
use Illuminate\Translation\Translator;
use Orchestra\Html\Builder as BaseBuilder;
use Illuminate\Contracts\View\Factory as View;
use Orchestra\Contracts\Html\Grid as GridContract;
use Orchestra\Contracts\Html\Table\Builder as BuilderContract;

class TableBuilder extends BaseBuilder implements BuilderContract
{
    /**
     * {@inheritdoc}
     */
    public function __construct(Request $request, Translator $translator, View $view, GridContract $grid)
    {
        $this->request    = $request;
        $this->translator = $translator;
        $this->view       = $view;
        $this->grid       = $grid;
    }

    /**
     * {@inheritdoc}
     */
    public function render()
    {
        $grid = $this->grid;

        // Add paginate value for current listing while appending query string,
        // however we also need to remove ?page from being added twice.
        $input = Arr::except($this->request->query(), [$grid->pageName]);

        $pagination = (true === $grid->paginated() ? $grid->model->appends($input) : '');

        $data = [
            'empty'      => $this->translator->get($grid->empty),
            'grid'       => $grid,
            'pagination' => $pagination,

            /* @deprecated 3.1.x */
            'attributes' => [
                'row'   => $grid->header(),
                'table' => $grid->attributes(),
            ],
            'rows'       => $grid->data(),
            'columns'    => $grid->columns(),
        ];

        // Build the view and render it.
        return $this->view->make($grid->view())->with($data)->render();
    }
}<commit_msg>Prepare output.<commit_after><?php namespace Orchestra\Html\Table;

use Illuminate\Support\Arr;
use Illuminate\Http\Request;
use Illuminate\Translation\Translator;
use Orchestra\Html\Builder as BaseBuilder;
use Illuminate\Contracts\View\Factory as View;
use Orchestra\Contracts\Html\Grid as GridContract;
use Orchestra\Contracts\Html\Table\Builder as BuilderContract;

class TableBuilder extends BaseBuilder implements BuilderContract
{
    /**
     * {@inheritdoc}
     */
    public function __construct(Request $request, Translator $translator, View $view, GridContract $grid)
    {
        $this->request    = $request;
        $this->translator = $translator;
        $this->view       = $view;
        $this->grid       = $grid;
    }

    /**
     * {@inheritdoc}
     */
    public function render()
    {
        $grid = $this->grid;

        // Add paginate value for current listing while appending query string,
        // however we also need to remove ?page from being added twice.
        $input = Arr::except($this->request->query(), [$grid->pageName]);

        $data = $grid->data();

        $pagination = (true === $grid->paginated() ? $grid->model->appends($input) : '');

        $data = [
            'empty'      => $this->translator->get($grid->empty),
            'grid'       => $grid,
            'pagination' => $pagination,

            /* @deprecated 3.1.x */
            'attributes' => [
                'row'   => $grid->header(),
                'table' => $grid->attributes(),
            ],
            'rows'       => $data,
            'columns'    => $grid->columns(),
        ];

        // Build the view and render it.
        return $this->view->make($grid->view())->with($data)->render();
    }
}
{'fraction_non_alphanumeric': 0.15248842592592593, 'fraction_numerical': 0.0011574074074074073, 'mean_word_length': 2.16865261228231, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 65, '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': '634102', 'n_tokens_mistral': 968, 'n_tokens_neox': 965, 'n_words': 223}