original_string: private function get_context_courseid(\context $context) {
  
          if (empty($this->contextcourseids[$context->id])) {
  
              $coursecontext = $context->get_course_context(false);
              if (!$coursecontext) {
                  // Default to the frontpage course context.
                  $coursecontext = \context_course::instance(SITEID);
              }
              $this->contextcourseids[$context->id] = $coursecontext->instanceid;
          }
  
          return $this->contextcourseids[$context->id];
      }
code: private function get_context_courseid(\context $context) {
  
          if (empty($this->contextcourseids[$context->id])) {
  
              $coursecontext = $context->get_course_context(false);
              if (!$coursecontext) {
                  // Default to the frontpage course context.
                  $coursecontext = \context_course::instance(SITEID);
              }
              $this->contextcourseids[$context->id] = $coursecontext->instanceid;
          }
  
          return $this->contextcourseids[$context->id];
      }
code_tokens: private function get_context_courseid ( \ context $ context ) { if ( empty ( $ this -> contextcourseids [ $ context -> id ] ) ) { $ coursecontext = $ context -> get_course_context ( false ) ; if ( ! $ coursecontext ) { // Default to the frontpage course context. $ coursecontext = \ context_course :: instance ( SITEID ) ; } $ this -> contextcourseids [ $ context -> id ] = $ coursecontext -> instanceid ; } return $ this -> contextcourseids [ $ context -> id ] ; }
docstring: Returns the course context of the provided context reading an internal cache first.
  
  @param  \context $context
  @return int
docstring_tokens: Returns the course context of the provided context reading an internal cache first .