original_string: protected static function call($function, array $data = [], $allowpublic = false) {
  
          $token = registration::get_token() ?: 'publichub';
          if (!$allowpublic && $token === 'publichub') {
              // This will throw an exception.
              registration::require_registration();
          }
  
          return self::call_rest($token, $function, $data);
      }
code: protected static function call($function, array $data = [], $allowpublic = false) {
  
          $token = registration::get_token() ?: 'publichub';
          if (!$allowpublic && $token === 'publichub') {
              // This will throw an exception.
              registration::require_registration();
          }
  
          return self::call_rest($token, $function, $data);
      }
code_tokens: protected static function call ( $ function , array $ data = [ ] , $ allowpublic = false ) { $ token = registration :: get_token ( ) ? : 'publichub' ; if ( ! $ allowpublic && $ token === 'publichub' ) { // This will throw an exception. registration :: require_registration ( ) ; } return self :: call_rest ( $ token , $ function , $ data ) ; }
docstring: Calls moodle.net WS
  
  @param string $function name of WS function
  @param array $data parameters of WS function
  @param bool $allowpublic allow request without moodle.net registration
  @return mixed depends on the function
  @throws moodle_exception
docstring_tokens: Calls moodle . net WS