<commit_before><?php

namespace Numa\DOAAdminBundle\Repository;

use Doctrine\ORM\EntityRepository;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;

class CommandLogRepository extends EntityRepository {
    /* @param integer $user_id
     * @return \Numa\DOAAdminBundle\Entity\Item
     */

    public function findLastCommandLog($limit) {
        $qb = $this->getEntityManager()
                ->createQueryBuilder();
        $qb->select('cl')->distinct()
                ->add('from', 'NumaDOAAdminBundle:CommandLog cl')
                ->orderBy('cl.id', 'DESC')
                ->getMaxResults($limit);
        ;

        $query = $qb->getQuery();
        return $query->getResult();
    }

    public function getCommandsByStatus($status='pending',$limit=0) {
        $qb = $this->getEntityManager()
                ->createQueryBuilder();
        $qb->select('cl')->distinct()
                ->add('from', 'NumaDOAAdminBundle:CommandLog cl')
                ->andWhere('cl.status like :status')<commit_msg>limit command logs<commit_after><?php

namespace Numa\DOAAdminBundle\Repository;

use Doctrine\ORM\EntityRepository;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;

class CommandLogRepository extends EntityRepository {
    /* @param integer $user_id
     * @return \Numa\DOAAdminBundle\Entity\Item
     */

    public function findLastCommandLog($limit=20) {
        $qb = $this->getEntityManager()
                ->createQueryBuilder();
        $qb->select('cl')->distinct()
                ->add('from', 'NumaDOAAdminBundle:CommandLog cl')
                ->orderBy('cl.id', 'DESC')

        ;

        $query = $qb->getQuery();
        $query->setMaxResults($limit);

        return $query->getResult();
    }

    public function getCommandsByStatus($status='pending',$limit=0) {
        $qb = $this->getEntityManager()
                ->createQueryBuilder();
        $qb->select('cl')->distinct()
                ->add('from', 'NumaDOAAdminBundle:CommandLog cl')
                ->andWhere('cl.status like :status')
{'fraction_non_alphanumeric': 0.14368370298939248, 'fraction_numerical': 0.0019286403085824494, 'mean_word_length': 2.646748681898067, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 33, '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': '675799', 'n_tokens_mistral': 601, 'n_tokens_neox': 590, 'n_words': 93}