<commit_before>#pragma once


template<typename Number>
Number to_even(Number number) {
  static_assert(std::is_integral<Number>(),
                "``Number`` should be integral type.");
  return Number(number / 2) * 2;
}


template<typename Number>
Number to_odd(Number number) {
  static_assert(std::is_integral<Number>(),
                "``Number`` should be integral type.");
  Number sign = number < 0 ? -1 : 1;
  return Number(number / 2 - sign) * 2 + sign;
}


char to_upper(char character);

char to_lower(char character);

std::string to_upper_string(const std::string &string);

std::string to_lower_string(const std::string &string);<commit_msg>Added 'to positive'/'to non-positive' operators<commit_after>#pragma once


template<typename Number>
Number to_even(Number number) {
  static_assert(std::is_integral<Number>(),
                "``Number`` should be integral type.");
  return Number(number / 2) * 2;
}


template<typename Number>
Number to_odd(Number number) {
  static_assert(std::is_integral<Number>(),
                "``Number`` should be integral type.");
  Number sign = number < 0 ? -1 : 1;
  return Number(number / 2 - sign) * 2 + sign;
}


template<typename Number>
Number to_positive(Number number) {
  static_assert(std::is_signed<Number>(),
                "``Number`` should be signed arithmetic type.");
  if (number == 0) {
    return 1;
  }
  return std::abs(number);
}


template<typename Number>
Number to_non_positive(Number number) {
  static_assert(std::is_signed<Number>(),
                "``Number`` should be signed arithmetic type.");
  return -std::abs(number);
}


char to_upper(char character);

char to_lower(char character);

std::string to_upper_string(const std::string &string);

std::string to_lower_string(const std::string &string);
{'fraction_non_alphanumeric': 0.13935340022296544, 'fraction_numerical': 0.008918617614269788, 'mean_word_length': 4.128571428571429, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, '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': '6093361', 'n_tokens_mistral': 579, 'n_tokens_neox': 539, 'n_words': 144}