original_string: public function get_course() {
          global $DB;
  
          if ($this->course) {
              return $this->course;
          }
  
          if (!$this->context) {
              return null;
          }
          $params = array('id' => $this->get_course_context()->instanceid);
          $this->course = $DB->get_record('course', $params, '*', MUST_EXIST);
  
          return $this->course;
      }
code: public function get_course() {
          global $DB;
  
          if ($this->course) {
              return $this->course;
          }
  
          if (!$this->context) {
              return null;
          }
          $params = array('id' => $this->get_course_context()->instanceid);
          $this->course = $DB->get_record('course', $params, '*', MUST_EXIST);
  
          return $this->course;
      }
code_tokens: public function get_course ( ) { global $ DB ; if ( $ this -> course ) { return $ this -> course ; } if ( ! $ this -> context ) { return null ; } $ params = array ( 'id' => $ this -> get_course_context ( ) -> instanceid ) ; $ this -> course = $ DB -> get_record ( 'course' , $ params , '*' , MUST_EXIST ) ; return $ this -> course ; }
docstring: Get the current course.
  
  @return mixed stdClass|null The course
docstring_tokens: Get the current course .