original_string: public function get_output_dir($subdirs = array(), $onlymodelid = false) {
          global $CFG;
  
          $subdirstr = '';
          foreach ($subdirs as $subdir) {
              $subdirstr .= DIRECTORY_SEPARATOR . $subdir;
          }
  
          $outputdir = get_config('analytics', 'modeloutputdir');
          if (empty($outputdir)) {
              // Apply default value.
              $outputdir = rtrim($CFG->dataroot, '/') . DIRECTORY_SEPARATOR . 'models';
          }
  
          // Append model id.
          $outputdir .= DIRECTORY_SEPARATOR . $this->model->id;
          if (!$onlymodelid) {
              // Append version + subdirs.
              $outputdir .= DIRECTORY_SEPARATOR . $this->model->version . $subdirstr;
          }
  
          make_writable_directory($outputdir);
  
          return $outputdir;
      }
code: public function get_output_dir($subdirs = array(), $onlymodelid = false) {
          global $CFG;
  
          $subdirstr = '';
          foreach ($subdirs as $subdir) {
              $subdirstr .= DIRECTORY_SEPARATOR . $subdir;
          }
  
          $outputdir = get_config('analytics', 'modeloutputdir');
          if (empty($outputdir)) {
              // Apply default value.
              $outputdir = rtrim($CFG->dataroot, '/') . DIRECTORY_SEPARATOR . 'models';
          }
  
          // Append model id.
          $outputdir .= DIRECTORY_SEPARATOR . $this->model->id;
          if (!$onlymodelid) {
              // Append version + subdirs.
              $outputdir .= DIRECTORY_SEPARATOR . $this->model->version . $subdirstr;
          }
  
          make_writable_directory($outputdir);
  
          return $outputdir;
      }
code_tokens: public function get_output_dir ( $ subdirs = array ( ) , $ onlymodelid = false ) { global $ CFG ; $ subdirstr = '' ; foreach ( $ subdirs as $ subdir ) { $ subdirstr .= DIRECTORY_SEPARATOR . $ subdir ; } $ outputdir = get_config ( 'analytics' , 'modeloutputdir' ) ; if ( empty ( $ outputdir ) ) { // Apply default value. $ outputdir = rtrim ( $ CFG -> dataroot , '/' ) . DIRECTORY_SEPARATOR . 'models' ; } // Append model id. $ outputdir .= DIRECTORY_SEPARATOR . $ this -> model -> id ; if ( ! $ onlymodelid ) { // Append version + subdirs. $ outputdir .= DIRECTORY_SEPARATOR . $ this -> model -> version . $ subdirstr ; } make_writable_directory ( $ outputdir ) ; return $ outputdir ; }
docstring: Returns the output directory for prediction processors.
  
  Directory structure as follows:
  - Evaluation runs:
  models/$model->id/$model->version/evaluation/$model->timesplitting
  - Training  & prediction runs:
  models/$model->id/$model->version/execution
  
  @param array $subdirs
  @param bool $onlymodelid Preference over $subdirs
  @return string
docstring_tokens: Returns the output directory for prediction processors .