<commit_before><?php

namespace PugAl\Bundle\OdalBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Response;

class DatasetController extends Controller {

  /**
   * @Route("/datasets", name="datasets")
   * @Template()
   */
  public function datasetsAction(Request $request) {
    $datasets = $this->get('pug_al_odal.ApiClient')->listAll();

    $response = new Response();

    $content = $this->renderView(
      'PugAlOdalBundle:Dataset:datasets.html.twig',
      array('title' => 'Datasets', 'datasets' => $datasets,)
    );
    $response->setMaxAge(600);

    return new Response($content);
  }

  /**
   * @Route("/dataset/{id}", name="dataset")
   * @Template()
   */
  public function datasetAction(Request $request, $id) {
    $dataset = $this->get('pug_al_odal.ApiClient')->getDataset($id);
    var_dump($dataset);

    return array(
      'title' => $dataset['title'],
      'dataset' => $dataset,
    );
  }

}
<commit_msg>aggiunta cache<commit_after><?php

namespace PugAl\Bundle\OdalBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Response;

class DatasetController extends Controller {

  /**
   * @Route("/datasets", name="datasets")
   * @Template()
   */
  public function datasetsAction(Request $request) {
    $datasets = $this->get('pug_al_odal.ApiClient')->listAll();

    $content = $this->renderView(
      'PugAlOdalBundle:Dataset:datasets.html.twig',
      array('title' => 'Datasets', 'datasets' => $datasets,)
    );

    $response = new Response($content);
    $response->setMaxAge(600);

    return $response;
  }

  /**
   * @Route("/dataset/{id}", name="dataset")
   * @Template()
   */
  public function datasetAction(Request $request, $id) {
    $dataset = $this->get('pug_al_odal.ApiClient')->getDataset($id);
    var_dump($dataset);

    return array(
      'title' => $dataset['title'],
      'dataset' => $dataset,
    );
  }

}

{'fraction_non_alphanumeric': 0.16025641025641027, 'fraction_numerical': 0.002564102564102564, 'mean_word_length': 4.237136465324385, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '5281513', 'n_tokens_mistral': 746, 'n_tokens_neox': 732, 'n_words': 114}