<commit_before>#ifndef __STAN__IO__MCMC__WRITER__HPP
#define __STAN__IO__MCMC__WRITER__HPP

#include <ostream>
#include <iomanip>

#include <vector>
#include <string>

#include <stan/mcmc/sample.hpp>
#include <stan/mcmc/base_mcmc.hpp>
#include <stan/model/prob_grad.hpp>

namespace stan {
  
  namespace io {
    
    template <class M>
    class mcmc_writer {
      
    public:
      
      mcmc_writer(std::ostream* sample_stream,
                  std::ostream* diagnostic_stream): _sample_stream(sample_stream),
                                                    _diagnostic_stream(diagnostic_stream) {}
      
      void print_sample_names(stan::mcmc::sample& sample,
                              stan::mcmc::base_mcmc& sampler,
                              M& model) {
        
        if(!_sample_stream) return;
        
        std::vector<std::string> names;
        
        sample.get_sample_param_names(names);
        sampler.get_sampler_param_names(names);
        model.constrained_param_names(names);
        
        (*_sample_stream) << names.at(0);
        for (int i = 1; i < names.size(); ++i) {
          (*_sample_stream) << "," << names.at(i);
        }
        (*_sample_stream) << std::endl;
        
      }
      
      void print_sample_params(stan::mcmc::sample& sample,<commit_msg>Don't include transformed/generated parameter names in header<commit_after>#ifndef __STAN__IO__MCMC__WRITER__HPP
#define __STAN__IO__MCMC__WRITER__HPP

#include <ostream>
#include <iomanip>

#include <vector>
#include <string>

#include <stan/mcmc/sample.hpp>
#include <stan/mcmc/base_mcmc.hpp>
#include <stan/model/prob_grad.hpp>

namespace stan {
  
  namespace io {
    
    template <class M>
    class mcmc_writer {
      
    public:
      
      mcmc_writer(std::ostream* sample_stream,
                  std::ostream* diagnostic_stream): _sample_stream(sample_stream),
                                                    _diagnostic_stream(diagnostic_stream) {}
      
      void print_sample_names(stan::mcmc::sample& sample,
                              stan::mcmc::base_mcmc& sampler,
                              M& model) {
        
        if(!_sample_stream) return;
        
        std::vector<std::string> names;
        
        sample.get_sample_param_names(names);
        sampler.get_sampler_param_names(names);
        model.constrained_param_names(names, false, false);
        
        (*_sample_stream) << names.at(0);
        for (int i = 1; i < names.size(); ++i) {
          (*_sample_stream) << "," << names.at(i);
        }
        (*_sample_stream) << std::endl;
        
      }
      
      void print_sample_params(stan::mcmc::sample& sample,
{'fraction_non_alphanumeric': 0.11201780415430267, 'fraction_numerical': 0.001483679525222552, 'mean_word_length': 2.1143187066974596, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5296078', 'n_tokens_mistral': 853, 'n_tokens_neox': 841, 'n_words': 135}