original_string: public function fetch_grade_or_default($item, $userid) {
          $grade = grade_grade::fetch(array(
              'itemid' => $item->id, 'userid' => $userid
          ));
  
          if (!$grade) {
              $default = new stdClass;
  
              $default->userid = $userid;
              $default->itemid = $item->id;
              $default->feedback = '';
  
              $grade = new grade_grade($default, false);
          }
  
          $grade->grade_item = $item;
  
          return $grade;
      }
code: public function fetch_grade_or_default($item, $userid) {
          $grade = grade_grade::fetch(array(
              'itemid' => $item->id, 'userid' => $userid
          ));
  
          if (!$grade) {
              $default = new stdClass;
  
              $default->userid = $userid;
              $default->itemid = $item->id;
              $default->feedback = '';
  
              $grade = new grade_grade($default, false);
          }
  
          $grade->grade_item = $item;
  
          return $grade;
      }
code_tokens: public function fetch_grade_or_default ( $ item , $ userid ) { $ grade = grade_grade :: fetch ( array ( 'itemid' => $ item -> id , 'userid' => $ userid ) ) ; if ( ! $ grade ) { $ default = new stdClass ; $ default -> userid = $ userid ; $ default -> itemid = $ item -> id ; $ default -> feedback = '' ; $ grade = new grade_grade ( $ default , false ) ; } $ grade -> grade_item = $ item ; return $ grade ; }
docstring: Get the grade_grade
  
  @param grade_item $item The grade_item
  @param int $userid The user id
  @return grade_grade
docstring_tokens: Get the grade_grade