original_string: public function trained_locally() : bool {
          global $DB;
  
          if (!$this->is_trained() || $this->is_static()) {
              // Early exit.
              return false;
          }
  
          if ($DB->record_exists('analytics_train_samples', ['modelid' => $this->model->id])) {
              return true;
          }
  
          return false;
      }
code: public function trained_locally() : bool {
          global $DB;
  
          if (!$this->is_trained() || $this->is_static()) {
              // Early exit.
              return false;
          }
  
          if ($DB->record_exists('analytics_train_samples', ['modelid' => $this->model->id])) {
              return true;
          }
  
          return false;
      }
code_tokens: public function trained_locally ( ) : bool { global $ DB ; if ( ! $ this -> is_trained ( ) || $ this -> is_static ( ) ) { // Early exit. return false ; } if ( $ DB -> record_exists ( 'analytics_train_samples' , [ 'modelid' => $ this -> model -> id ] ) ) { return true ; } return false ; }
docstring: Has the model been trained using data from this site?
  
  This method is useful to determine if a trained model can be evaluated as
  we can not use the same data for training and for evaluation.
  
  @return bool
docstring_tokens: Has the model been trained using data from this site?