<commit_before><?php

namespace HubDrop\Bundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Guzzle\Http\Client;
use Github\Client as GithubClient;

use Symfony\Component\HttpFoundation\Session\Session;


class HubDropController extends Controller
{

  /**
   * Route: Homepage
   */
  public function homeAction()
  {
    $project_name = $this->get('request')->query->get('project_name');
    if ($project_name){
      return $this->redirect($this->generateUrl('_project', array(
        'project_name' => $project_name
      )));
    }

    return $this->render('HubDropBundle:HubDrop:home.html.twig', array(
      'site_base_url' => $this->getRequest()->getHost(),
    ));
  }

  /**
   * Route: Project View Page
   */
  public function projectAction($project_name)
  {
    $session = new Session();
    $session->start();

    // @TODO: Break out into its own route. Require a POST? Symfony Form API?
    // Mirror: GO!
    // We only want to try to mirror a project if not yet cloned and it exists.

    // Get Project object
    $project = $this->get('hubdrop')->getProject($project_name);

    // If ?mirror=go
    if ($project->mirrored == FALSE && $this->get('request')->query->get('mirror') == 'go'){
      $project->initMirror();
      return $this->redirect('/project/' . $project_name);<commit_msg>removing session stuff thats unneeded and breaking.<commit_after><?php

namespace HubDrop\Bundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Guzzle\Http\Client;
use Github\Client as GithubClient;

use Symfony\Component\HttpFoundation\Session\Session;


class HubDropController extends Controller
{

  /**
   * Route: Homepage
   */
  public function homeAction()
  {
    $project_name = $this->get('request')->query->get('project_name');
    if ($project_name){
      return $this->redirect($this->generateUrl('_project', array(
        'project_name' => $project_name
      )));
    }

    return $this->render('HubDropBundle:HubDrop:home.html.twig', array(
      'site_base_url' => $this->getRequest()->getHost(),
    ));
  }

  /**
   * Route: Project View Page
   */
  public function projectAction($project_name)
  {

    // @TODO: Break out into its own route. Require a POST? Symfony Form API?
    // Mirror: GO!
    // We only want to try to mirror a project if not yet cloned and it exists.

    // Get Project object
    $project = $this->get('hubdrop')->getProject($project_name);

    // If ?mirror=go
    if ($project->mirrored == FALSE && $this->get('request')->query->get('mirror') == 'go'){
      $project->initMirror();
      return $this->redirect('/project/' . $project_name);
{'fraction_non_alphanumeric': 0.15523059617547807, 'fraction_numerical': 0.0, 'mean_word_length': 3.4615384615384617, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 40, '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': '3013163', 'n_tokens_mistral': 821, 'n_tokens_neox': 793, 'n_words': 189}