original_string: public function getStatistics($status)
      {
          $qb = $this->createQueryBuilder('q');
          $qb->select('SUBSTRING(q.job, 1, 200) AS class');
          $qb->where($qb->expr()->eq('q.status', $qb->expr()->literal($status)));
  
          $result = $qb->getQuery()->getScalarResult();
  
          $stats = [];
          foreach ($result as $item) {
              if (!preg_match('/"(.+?)"/', $item['class'], $match)) {
                  continue;
              }
              $class = $match[1];
              if (!isset($stats[$class])) {
                  $stats[$class] = 0;
              }
              ++$stats[$class];
          }
  
          return $stats;
      }
code: public function getStatistics($status)
      {
          $qb = $this->createQueryBuilder('q');
          $qb->select('SUBSTRING(q.job, 1, 200) AS class');
          $qb->where($qb->expr()->eq('q.status', $qb->expr()->literal($status)));
  
          $result = $qb->getQuery()->getScalarResult();
  
          $stats = [];
          foreach ($result as $item) {
              if (!preg_match('/"(.+?)"/', $item['class'], $match)) {
                  continue;
              }
              $class = $match[1];
              if (!isset($stats[$class])) {
                  $stats[$class] = 0;
              }
              ++$stats[$class];
          }
  
          return $stats;
      }
code_tokens: public function getStatistics ( $ status ) { $ qb = $ this -> createQueryBuilder ( 'q' ) ; $ qb -> select ( 'SUBSTRING(q.job, 1, 200) AS class' ) ; $ qb -> where ( $ qb -> expr ( ) -> eq ( 'q.status' , $ qb -> expr ( ) -> literal ( $ status ) ) ) ; $ result = $ qb -> getQuery ( ) -> getScalarResult ( ) ; $ stats = [ ] ; foreach ( $ result as $ item ) { if ( ! preg_match ( '/"(.+?)"/' , $ item [ 'class' ] , $ match ) ) { continue ; } $ class = $ match [ 1 ] ; if ( ! isset ( $ stats [ $ class ] ) ) { $ stats [ $ class ] = 0 ; } ++ $ stats [ $ class ] ; } return $ stats ; }
docstring: Return job statistics.
  
  @param int $status
  
  @return array
docstring_tokens: Return job statistics .