<commit_before>#ifndef STAN_MATH_PRIM_ERR_CHECK_FINITE_HPP
#define STAN_MATH_PRIM_ERR_CHECK_FINITE_HPP

#include <stan/math/prim/err/elementwise_check.hpp>

namespace stan {
namespace math {
  
/**
 * Check if each element of the eigen variable <code>y</code> is finite.
 *
 * @tparam T_y type of y
 * @param function function name (for error messages)
 * @param name variable name (for error messages)
 * @param y variable to check
 * @throw <code>domain_error</code> if y is infinity, -infinity, or NaN
 */
template <typename T_y, require_eigen_t<T_y>* = nullptr>
inline void check_finite(const char* function, const char* name, const T_y& y) {
  if(!value_of_rec(y).allFinite()) {
    auto is_good = [](const auto& y) { return std::isfinite(y); };
    elementwise_check(is_good, function, name, y, ", but must be finite!");
  }
}

/**
 * Check if <code>y</code> is finite.
 * This function is vectorized and will check each element of
 * <code>y</code>.
 * @tparam T_y type of y
 * @param function function name (for error messages)
 * @param name variable name (for error messages)
 * @param y variable to check
 * @throw <code>domain_error</code> if y is infinity, -infinity, or NaN
 */
template <typename T_y, require_not_eigen_t<T_y>* = nullptr>
inline void check_finite(const char* function, const char* name, const T_y& y) {
  auto is_good = [](const auto& y) { return std::isfinite(y); };<commit_msg>[Jenkins] auto-formatting by clang-format version 6.0.0-1ubuntu2~16.04.1 (tags/RELEASE_600/final)<commit_after>#ifndef STAN_MATH_PRIM_ERR_CHECK_FINITE_HPP
#define STAN_MATH_PRIM_ERR_CHECK_FINITE_HPP

#include <stan/math/prim/err/elementwise_check.hpp>

namespace stan {
namespace math {

/**
 * Check if each element of the eigen variable <code>y</code> is finite.
 *
 * @tparam T_y type of y
 * @param function function name (for error messages)
 * @param name variable name (for error messages)
 * @param y variable to check
 * @throw <code>domain_error</code> if y is infinity, -infinity, or NaN
 */
template <typename T_y, require_eigen_t<T_y>* = nullptr>
inline void check_finite(const char* function, const char* name, const T_y& y) {
  if (!value_of_rec(y).allFinite()) {
    auto is_good = [](const auto& y) { return std::isfinite(y); };
    elementwise_check(is_good, function, name, y, ", but must be finite!");
  }
}

/**
 * Check if <code>y</code> is finite.
 * This function is vectorized and will check each element of
 * <code>y</code>.
 * @tparam T_y type of y
 * @param function function name (for error messages)
 * @param name variable name (for error messages)
 * @param y variable to check
 * @throw <code>domain_error</code> if y is infinity, -infinity, or NaN
 */
template <typename T_y, require_not_eigen_t<T_y>* = nullptr>
inline void check_finite(const char* function, const char* name, const T_y& y) {
  auto is_good = [](const auto& y) { return std::isfinite(y); };
{'fraction_non_alphanumeric': 0.12332070272132277, 'fraction_numerical': 0.0044781260764726145, 'mean_word_length': 4.6608187134502925, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '652881', 'n_tokens_mistral': 998, 'n_tokens_neox': 972, 'n_words': 323}