original_string: public function get_contextvisibility($context) {
          global $USER;
  
          if ($context->contextlevel == CONTEXT_COURSE) {
              return $this->_options['enablecourseinstances'];
          }
  
          if ($context->contextlevel == CONTEXT_USER) {
              return $this->_options['enableuserinstances'];
          }
  
          //the context is SITE
          return true;
      }
code: public function get_contextvisibility($context) {
          global $USER;
  
          if ($context->contextlevel == CONTEXT_COURSE) {
              return $this->_options['enablecourseinstances'];
          }
  
          if ($context->contextlevel == CONTEXT_USER) {
              return $this->_options['enableuserinstances'];
          }
  
          //the context is SITE
          return true;
      }
code_tokens: public function get_contextvisibility ( $ context ) { global $ USER ; if ( $ context -> contextlevel == CONTEXT_COURSE ) { return $ this -> _options [ 'enablecourseinstances' ] ; } if ( $ context -> contextlevel == CONTEXT_USER ) { return $ this -> _options [ 'enableuserinstances' ] ; } //the context is SITE return true ; }
docstring: Return if the instance is visible in a context
  
  @todo check if the context visibility has been overwritten by the plugin creator
  (need to create special functions to be overvwritten in repository class)
  @param stdClass $context context
  @return bool
docstring_tokens: Return if the instance is visible in a context