<commit_before><?php

namespace App\Http\Controllers\Api;

use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Transformers\AssetsTransformer;
use App\Http\Transformers\StatuslabelsTransformer;
use App\Models\Asset;
use App\Models\Statuslabel;
use Illuminate\Http\Request;

class StatuslabelsController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @author [<NAME>] [<<EMAIL>>]
     * @since [v4.0]
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {
        $this->authorize('view', Statuslabel::class);
        $allowed_columns = ['id', 'name', 'created_at', 'assets_count', 'color', 'notes', 'default_label'];

        $statuslabels = Statuslabel::withCount('assets as assets_count');

        if ($request->filled('search')) {
            $statuslabels = $statuslabels->TextSearch($request->input('search'));
        }


        // if a status_type is passed, filter by that
        if ($request->filled('status_type')) {
            if (strtolower($request->input('status_type'))== 'pending') {
                $statuslabels = $statuslabels->Pending();
            } elseif (strtolower($request->input('status_type'))== 'archived') {
                $statuslabels = $statuslabels->Archived();
            } elseif (strtolower($request->input('status_type'))== 'deployable') {
                $statuslabels = $statuslabels->Deployable();
            } elseif (strtolower($request->input('status_type'))== 'undeployable') {
                $statuslabels = $statuslabels->Undeployable();
            }

        }

        // Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
        // case we override with the actual count, so we should return 0 items.
        $offset = (($statuslabels) && ($request->get('offset') > $statuslabels->count())) ? $statuslabels->count() : $request->get('offset', 0);<commit_msg>Removed extra space because pedantry<commit_after><?php

namespace App\Http\Controllers\Api;

use App\Helpers\Helper;
use App\Http\Controllers\Controller;
use App\Http\Transformers\AssetsTransformer;
use App\Http\Transformers\StatuslabelsTransformer;
use App\Models\Asset;
use App\Models\Statuslabel;
use Illuminate\Http\Request;

class StatuslabelsController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @author [<NAME>] [<<EMAIL>>]
     * @since [v4.0]
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {
        $this->authorize('view', Statuslabel::class);
        $allowed_columns = ['id', 'name', 'created_at', 'assets_count', 'color', 'notes', 'default_label'];

        $statuslabels = Statuslabel::withCount('assets as assets_count');

        if ($request->filled('search')) {
            $statuslabels = $statuslabels->TextSearch($request->input('search'));
        }


        // if a status_type is passed, filter by that
        if ($request->filled('status_type')) {
            if (strtolower($request->input('status_type'))== 'pending') {
                $statuslabels = $statuslabels->Pending();
            } elseif (strtolower($request->input('status_type'))== 'archived') {
                $statuslabels = $statuslabels->Archived();
            } elseif (strtolower($request->input('status_type'))== 'deployable') {
                $statuslabels = $statuslabels->Deployable();
            } elseif (strtolower($request->input('status_type'))== 'undeployable') {
                $statuslabels = $statuslabels->Undeployable();
            }
        }

        // Set the offset to the API call's offset, unless the offset is higher than the actual count of items in which
        // case we override with the actual count, so we should return 0 items.
        $offset = (($statuslabels) && ($request->get('offset') > $statuslabels->count())) ? $statuslabels->count() : $request->get('offset', 0);
{'fraction_non_alphanumeric': 0.1511803114013059, 'fraction_numerical': 0.0020090406830738324, 'mean_word_length': 3.0642857142857145, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 45, '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': '5520983', 'n_tokens_mistral': 1110, 'n_tokens_neox': 1100, 'n_words': 257}