<commit_before>#ifndef STAN_IO_ARRAY_VAR_CONTEXT_HPP
#define STAN_IO_ARRAY_VAR_CONTEXT_HPP

#include <stan/io/var_context.hpp>
#include <boost/throw_exception.hpp>
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <algorithm>
#include <functional>
#include <numeric>
#include <sstream>
#include <string>
#include <type_traits>
#include <vector>
#include <utility>

namespace stan {

namespace io {

/**
 * An array_var_context object represents a named arrays
 * with dimensions constructed from an array, a vector
 * of names, and a vector of all dimensions for each element.
 */
class array_var_context : public var_context {
 private:
  // Pairs
  template <typename T>
  using pair_
      = std::pair<std::string, std::pair<std::vector<T>, std::vector<size_t>>>;

  // Map holding reals
  using map_r_ = std::vector<pair_<double>>;
  map_r_ vars_r_;
  using map_i_ = std::vector<pair_<int>>;
  map_i_ vars_i_;
  // When search for variable name fails, return one these
  std::vector<double> const empty_vec_r_;
  std::vector<int> const empty_vec_i_;
  std::vector<size_t> const empty_vec_ui_;

  template <typename Str>
  auto find_var_r(Str&& name) const {
    return std::find_if(vars_r_.begin(), vars_r_.end(),
     [&](auto&& element){ return element.first == name;});
  }

  template <typename Str>
  auto find_var_i(Str&& name) const {
    return std::find_if(vars_i_.begin(), vars_i_.end(),
     [&](auto&& element){ return element.first == name;});
  }

  // Find method
  bool contains_r_only(const std::string& name) const {
    return find_var_r(name) != vars_r_.end();
  }

  /**
   * Check (1) if the vector size of dimensions is no smaller
   * than the name vector size; (2) if the size of the input<commit_msg>[Jenkins] auto-formatting by clang-format version 6.0.0 (tags/google/stable/2017-11-14)<commit_after>#ifndef STAN_IO_ARRAY_VAR_CONTEXT_HPP
#define STAN_IO_ARRAY_VAR_CONTEXT_HPP

#include <stan/io/var_context.hpp>
#include <boost/throw_exception.hpp>
#include <stan/math/prim/mat/fun/Eigen.hpp>
#include <algorithm>
#include <functional>
#include <numeric>
#include <sstream>
#include <string>
#include <type_traits>
#include <vector>
#include <utility>

namespace stan {

namespace io {

/**
 * An array_var_context object represents a named arrays
 * with dimensions constructed from an array, a vector
 * of names, and a vector of all dimensions for each element.
 */
class array_var_context : public var_context {
 private:
  // Pairs
  template <typename T>
  using pair_
      = std::pair<std::string, std::pair<std::vector<T>, std::vector<size_t>>>;

  // Map holding reals
  using map_r_ = std::vector<pair_<double>>;
  map_r_ vars_r_;
  using map_i_ = std::vector<pair_<int>>;
  map_i_ vars_i_;
  // When search for variable name fails, return one these
  std::vector<double> const empty_vec_r_;
  std::vector<int> const empty_vec_i_;
  std::vector<size_t> const empty_vec_ui_;

  template <typename Str>
  auto find_var_r(Str&& name) const {
    return std::find_if(vars_r_.begin(), vars_r_.end(),
                        [&](auto&& element) { return element.first == name; });
  }

  template <typename Str>
  auto find_var_i(Str&& name) const {
    return std::find_if(vars_i_.begin(), vars_i_.end(),
                        [&](auto&& element) { return element.first == name; });
  }

  // Find method
  bool contains_r_only(const std::string& name) const {
    return find_var_r(name) != vars_r_.end();
  }

  /**
   * Check (1) if the vector size of dimensions is no smaller
   * than the name vector size; (2) if the size of the input
{'fraction_non_alphanumeric': 0.12869905080960356, 'fraction_numerical': 0.0041876046901172526, 'mean_word_length': 4.238304093567251, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '107210', 'n_tokens_mistral': 1225, 'n_tokens_neox': 1201, 'n_words': 333}