<commit_before><?php

namespace app\controllers;

use Yii;
use yii\web\Controller;
use yii\filters\VerbFilter;
use app\models\RecipeForm;
use yii\web\UploadedFile;
use yii\helpers\Json;
use yii\widgets\ActiveForm;

class SiteController extends Controller
{
    public function actions()
    {
        return [
            'error' => [
                'class' => 'yii\web\ErrorAction',
            ],
        ];
    }

    public function actionIndex()
    {
        $model = new RecipeForm();
        $recipe = false;
        if (Yii::$app->request->post()) {
            $model->load(Yii::$app->request->post());
            $model->file = UploadedFile::getInstance($model, 'file');

            if ($model->validate()) {
                $recipe = $model->findRecipes();
            } 
        }

        return $this->render('index', [
            'model' => $model,
            'recipe' => $recipe,
        ]);
    }

    public function actionAbout()
    {
        return $this->render('about');
    }    <commit_msg>adding more things for testing<commit_after><?php

namespace app\controllers;

use Yii;
use yii\web\Controller;
use yii\filters\VerbFilter;
use app\models\RecipeForm;
use yii\web\UploadedFile;
use yii\helpers\Json;
use yii\widgets\ActiveForm;

class SiteController extends Controller
{
    public function actions()
    {
        return [
            'error' => [
                'class' => 'yii\web\ErrorAction',
            ],
        ];
    }

    public function actionIndex()
    {
        $model = new RecipeForm();
        $recipe = false;
	if (Yii::$app->request->isAjax)  { 
	    $model->load(Yii::$app->request->post()); 
	    Yii::$app->response->format = Response::FORMAT_JSON; 
	    return ActiveForm::validate($model); 
	} elseif (Yii::$app->request->post()) {
            $model->load(Yii::$app->request->post());
            $model->file = UploadedFile::getInstance($model, 'file');

            if ($model->validate()) {
                $recipe = $model->findRecipes();
            } 
        }

        return $this->render('index', [
            'model' => $model,
            'recipe' => $recipe,
        ]);
    }

    public function actionAbout()
    {
        return $this->render('about');
    }    
{'fraction_non_alphanumeric': 0.15723830734966593, 'fraction_numerical': 0.0, 'mean_word_length': 2.0188172043010755, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 38, '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': '3077899', 'n_tokens_mistral': 693, 'n_tokens_neox': 681, 'n_words': 125}