original_string: public function get_course_context() {
          if (!$this->context && !$this->course) {
              throw new coding_exception('Improper use of the assignment class. ' .
                                         'Cannot load the course context.');
          }
          if ($this->context) {
              return $this->context->get_course_context();
          } else {
              return context_course::instance($this->course->id);
          }
      }
code: public function get_course_context() {
          if (!$this->context && !$this->course) {
              throw new coding_exception('Improper use of the assignment class. ' .
                                         'Cannot load the course context.');
          }
          if ($this->context) {
              return $this->context->get_course_context();
          } else {
              return context_course::instance($this->course->id);
          }
      }
code_tokens: public function get_course_context ( ) { if ( ! $ this -> context && ! $ this -> course ) { throw new coding_exception ( 'Improper use of the assignment class. ' . 'Cannot load the course context.' ) ; } if ( $ this -> context ) { return $ this -> context -> get_course_context ( ) ; } else { return context_course :: instance ( $ this -> course -> id ) ; } }
docstring: Get the context of the current course.
  
  @return mixed context|null The course context
docstring_tokens: Get the context of the current course .