original_string: public function get_aggregation_method($aggregate) {
          $aggregatestr = null;
          switch($aggregate){
              case RATING_AGGREGATE_AVERAGE:
                  $aggregatestr = 'AVG';
                  break;
              case RATING_AGGREGATE_COUNT:
                  $aggregatestr = 'COUNT';
                  break;
              case RATING_AGGREGATE_MAXIMUM:
                  $aggregatestr = 'MAX';
                  break;
              case RATING_AGGREGATE_MINIMUM:
                  $aggregatestr = 'MIN';
                  break;
              case RATING_AGGREGATE_SUM:
                  $aggregatestr = 'SUM';
                  break;
              default:
                  $aggregatestr = 'AVG'; // Default to this to avoid real breakage - MDL-22270.
                  debugging('Incorrect call to get_aggregation_method(), incorrect aggregate method ' . $aggregate, DEBUG_DEVELOPER);
          }
          return $aggregatestr;
      }
code: public function get_aggregation_method($aggregate) {
          $aggregatestr = null;
          switch($aggregate){
              case RATING_AGGREGATE_AVERAGE:
                  $aggregatestr = 'AVG';
                  break;
              case RATING_AGGREGATE_COUNT:
                  $aggregatestr = 'COUNT';
                  break;
              case RATING_AGGREGATE_MAXIMUM:
                  $aggregatestr = 'MAX';
                  break;
              case RATING_AGGREGATE_MINIMUM:
                  $aggregatestr = 'MIN';
                  break;
              case RATING_AGGREGATE_SUM:
                  $aggregatestr = 'SUM';
                  break;
              default:
                  $aggregatestr = 'AVG'; // Default to this to avoid real breakage - MDL-22270.
                  debugging('Incorrect call to get_aggregation_method(), incorrect aggregate method ' . $aggregate, DEBUG_DEVELOPER);
          }
          return $aggregatestr;
      }
code_tokens: public function get_aggregation_method ( $ aggregate ) { $ aggregatestr = null ; switch ( $ aggregate ) { case RATING_AGGREGATE_AVERAGE : $ aggregatestr = 'AVG' ; break ; case RATING_AGGREGATE_COUNT : $ aggregatestr = 'COUNT' ; break ; case RATING_AGGREGATE_MAXIMUM : $ aggregatestr = 'MAX' ; break ; case RATING_AGGREGATE_MINIMUM : $ aggregatestr = 'MIN' ; break ; case RATING_AGGREGATE_SUM : $ aggregatestr = 'SUM' ; break ; default : $ aggregatestr = 'AVG' ; // Default to this to avoid real breakage - MDL-22270. debugging ( 'Incorrect call to get_aggregation_method(), incorrect aggregate method ' . $ aggregate , DEBUG_DEVELOPER ) ; } return $ aggregatestr ; }
docstring: Converts an aggregation method constant into something that can be included in SQL
  
  @param int $aggregate An aggregation constant. For example, RATING_AGGREGATE_AVERAGE.
  @return string an SQL aggregation method
docstring_tokens: Converts an aggregation method constant into something that can be included in SQL