<commit_before>################################################################################################
# Univeral Arithmetic Library status report function.
# Automatically align right column and selects text based on condition.

function(universal_status text)
  set(status_cond)
  set(status_then)
  set(status_else)

  set(status_current_name "cond")
  foreach(arg ${ARGN})
    if(arg STREQUAL "THEN")
      set(status_current_name "then")
    elseif(arg STREQUAL "ELSE")
      set(status_current_name "else")
    else()
      list(APPEND status_${status_current_name} ${arg})
    endif()
  endforeach()

  if(DEFINED status_cond)
    set(status_placeholder_length 23)
    string(RANDOM LENGTH ${status_placeholder_length} ALPHABET " " status_placeholder)
    string(LENGTH "${text}" status_text_length)
    if(status_text_length LESS status_placeholder_length)
      string(SUBSTRING "${text}${status_placeholder}" 0 ${status_placeholder_length} status_text)
    elseif(DEFINED status_then OR DEFINED status_else)
      message(STATUS "${text}")
      set(status_text "${status_placeholder}")
    else()
      set(status_text "${text}")
    endif()

    if(DEFINED status_then OR DEFINED status_else)
      if(${status_cond})
        string(REPLACE ";" " " status_then "${status_then}")
        string(REGEX REPLACE "^[ \t]+" "" status_then "${status_then}")
        message(STATUS "${status_text} ${status_then}")
      else()
        string(REPLACE ";" " " status_else "${status_else}")
        string(REGEX REPLACE "^[ \t]+" "" status_else "${status_else}")
        message(STATUS "${status_text} ${status_else}")
      endif()
    else()
      string(REPLACE ";" " " status_cond "${status_cond}")
      string(REGEX REPLACE "^[ \t]+" "" status_cond "${status_cond}")
      message(STATUS "${status_text} ${status_cond}")
    endif()
  else()
    message(STATUS "${text}")
  endif()
endfunction()

################################################################################################
# Function merging lists of compiler flags to single string.
# Usage:
#   universal_merge_flag_lists(out_variable <list1> [<list2>] [<list3>] ...)
function(universal_merge_flag_lists out_var)
  set(__result "")
  foreach(__list ${ARGN})
    foreach(__flag ${${__list}})
      string(STRIP ${__flag} __flag)
      set(__result "${__result} ${__flag}")
    endforeach()
  endforeach()
  string(STRIP ${__result} __result)
  set(${out_var} ${__result} PARENT_SCOPE)
endfunction()

####
# Prints accumulated universal arithmetic library configuration summary
# Usage:
#   universal_print_configuration_summary()

function(universal_print_configuration_summary)

    universal_merge_flag_lists(__flags_rel CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS)
    universal_merge_flag_lists(__flags_deb CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS)

    universal_status("")
    universal_status("******************* Universal Arithmetic Library Configuration Summary *******************")
    universal_status("General:")
    universal_status("  Version                      :   ${PROJECT_VERSION}")
    universal_status("  System                       :   ${CMAKE_SYSTEM_NAME}")
    universal_status("  C++ compiler                 :   ${CMAKE_CXX_COMPILER}")
    universal_status("  Release CXX flags            :   ${__flags_rel}")
    universal_status("  Debug CXX flags              :   ${__flags_deb}")
    universal_status("  Build type                   :   ${CMAKE_BUILD_TYPE}")
    universal_status("")
    universal_status("  BUILD_CI_CHECK               :   ${BUILD_CI_CHECK}")
    universal_status("")
    universal_status("  BUILD_BITBLOCK               :   ${BUILD_BITBLOCK}")
    universal_status("  BUILD_REAL_NUMBER            :   ${BUILD_REAL_NUMBER}")
    universal_status("  BUILD_UNUM_TYPE_1            :   ${BUILD_UNUM_TYPE_1}")
    universal_status("  BUILD_UNUM_TYPE_2            :   ${BUILD_UNUM_TYPE_2}")
    universal_status("  BUILD_UNUM_TYPE_3_POSIT      :   ${BUILD_UNUM_TYPE_3_POSIT}")
    universal_status("  BUILD_UNUM_TYPE_3_VALID      :   ${BUILD_UNUM_TYPE_3_VALID}")
    universal_status("  BUILD_APF                    :   ${BUILD_APF}")
    universal_status("")
    universal_status("  BUILD_C_API_LIB              :   ${BUILD_C_API_LIB}")
    universal_status("")
    universal_status("  BUILD_CI_CHECK               :   ${BUILD_CI_CHECK}")
    universal_status("  BUILD_CMD_LINE_TOOLS         :   ${BUILD_CMD_LINE_TOOLS}")
    universal_status("  BUILD_EDUCATION_EXAMPLES     :   ${BUILD_EDUCATION_EXAMPLES}")
    universal_status("  BUILD_APPLICATION_EXAMPLES   :   ${BUILD_APPLICATION_EXAMPLES}")
    universal_status("  BUILD_PLAYGROUND             :   ${BUILD_PLAYGROUND}")
    universal_status("")
    universal_status("  BUILD_PERF_TESTS             :   ${BUILD_PERF_TESTS}")
    universal_status("")
    universal_status("  BUILD_IEEE_FLOAT_QUIRES      :   ${BUILD_IEEE_FLOAT_QUIRES}")
    universal_status("")
    universal_status("  BUILD_DOCS                   :   ${BUILD_DOCS}")
    universal_status("")
    universal_status("Dependencies:")
    universal_status("  SSE3                         : " USE_SSE3 AND COMPILER_HAS_SSE3_FLAG THEN "Yes" ELSE "No")
    universal_status("  AVX                          : " USE_AVX AND COMPILER_HAS_AVX_FLAG THEN "Yes" ELSE "No")
    universal_status("  AVX2                         : " USE_AVX2 AND COMPILER_HAS_AVX2_FLAG THEN "Yes" ELSE "No")
    universal_status("  Pthread                      : " USE_PTHREAD THEN "Yes" ELSE "No")
    universal_status("  TBB                          : " USE_TBB AND TBB_FOUND THEN "Yes (ver. ${TBB_INTERFACE_VERSION})" ELSE "No")
    universal_status("  OMP                          : " USE_OMP AND OMP_FOUND THEN "Yes" ELSE "No")
    #universal_status("  OpenCL                       : " USE_OPENCL AND OpenCL_FOUND THEN "Yes (ver. ${OpenCL_VERSION_STRING})" ELSE "No")
    universal_status("")
    universal_status("Utilities:")
    #universal_status("  OpenCV                       : " USE_OPENCV AND OpenCV_FOUND THEN "Yes (ver. ${OpenCV_VERSION})" ELSE "No")
    universal_status("  Serializer                   : " USE_SERIALIZER THEN "Yes" ELSE "No")
    #universal_status("  Image API                    : " USE_IMAGE_API THEN "Yes" ELSE "No")
    #universal_status("  Gemmlowp                     : " USE_GEMMLOWP THEN "Yes" ELSE "No")
    universal_status("")
    universal_status("Install:")
    universal_status("  Install path                 :   ${CMAKE_INSTALL_PREFIX}")
    universal_status("")
endfunction()<commit_msg>removing duplicate BUILD_CI_CHECK reporting in summary<commit_after>################################################################################################
# Univeral Arithmetic Library status report function.
# Automatically align right column and selects text based on condition.

function(universal_status text)
  set(status_cond)
  set(status_then)
  set(status_else)

  set(status_current_name "cond")
  foreach(arg ${ARGN})
    if(arg STREQUAL "THEN")
      set(status_current_name "then")
    elseif(arg STREQUAL "ELSE")
      set(status_current_name "else")
    else()
      list(APPEND status_${status_current_name} ${arg})
    endif()
  endforeach()

  if(DEFINED status_cond)
    set(status_placeholder_length 23)
    string(RANDOM LENGTH ${status_placeholder_length} ALPHABET " " status_placeholder)
    string(LENGTH "${text}" status_text_length)
    if(status_text_length LESS status_placeholder_length)
      string(SUBSTRING "${text}${status_placeholder}" 0 ${status_placeholder_length} status_text)
    elseif(DEFINED status_then OR DEFINED status_else)
      message(STATUS "${text}")
      set(status_text "${status_placeholder}")
    else()
      set(status_text "${text}")
    endif()

    if(DEFINED status_then OR DEFINED status_else)
      if(${status_cond})
        string(REPLACE ";" " " status_then "${status_then}")
        string(REGEX REPLACE "^[ \t]+" "" status_then "${status_then}")
        message(STATUS "${status_text} ${status_then}")
      else()
        string(REPLACE ";" " " status_else "${status_else}")
        string(REGEX REPLACE "^[ \t]+" "" status_else "${status_else}")
        message(STATUS "${status_text} ${status_else}")
      endif()
    else()
      string(REPLACE ";" " " status_cond "${status_cond}")
      string(REGEX REPLACE "^[ \t]+" "" status_cond "${status_cond}")
      message(STATUS "${status_text} ${status_cond}")
    endif()
  else()
    message(STATUS "${text}")
  endif()
endfunction()

################################################################################################
# Function merging lists of compiler flags to single string.
# Usage:
#   universal_merge_flag_lists(out_variable <list1> [<list2>] [<list3>] ...)
function(universal_merge_flag_lists out_var)
  set(__result "")
  foreach(__list ${ARGN})
    foreach(__flag ${${__list}})
      string(STRIP ${__flag} __flag)
      set(__result "${__result} ${__flag}")
    endforeach()
  endforeach()
  string(STRIP ${__result} __result)
  set(${out_var} ${__result} PARENT_SCOPE)
endfunction()

####
# Prints accumulated universal arithmetic library configuration summary
# Usage:
#   universal_print_configuration_summary()

function(universal_print_configuration_summary)

    universal_merge_flag_lists(__flags_rel CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS)
    universal_merge_flag_lists(__flags_deb CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS)

    universal_status("")
    universal_status("******************* Universal Arithmetic Library Configuration Summary *******************")
    universal_status("General:")
    universal_status("  Version                      :   ${PROJECT_VERSION}")
    universal_status("  System                       :   ${CMAKE_SYSTEM_NAME}")
    universal_status("  C++ compiler                 :   ${CMAKE_CXX_COMPILER}")
    universal_status("  Release CXX flags            :   ${__flags_rel}")
    universal_status("  Debug CXX flags              :   ${__flags_deb}")
    universal_status("  Build type                   :   ${CMAKE_BUILD_TYPE}")
    universal_status("")
    universal_status("  BUILD_CI_CHECK               :   ${BUILD_CI_CHECK}")
    universal_status("")
    universal_status("  BUILD_BITBLOCK               :   ${BUILD_BITBLOCK}")
    universal_status("  BUILD_REAL_NUMBER            :   ${BUILD_REAL_NUMBER}")
    universal_status("  BUILD_UNUM_TYPE_1            :   ${BUILD_UNUM_TYPE_1}")
    universal_status("  BUILD_UNUM_TYPE_2            :   ${BUILD_UNUM_TYPE_2}")
    universal_status("  BUILD_UNUM_TYPE_3_POSIT      :   ${BUILD_UNUM_TYPE_3_POSIT}")
    universal_status("  BUILD_UNUM_TYPE_3_VALID      :   ${BUILD_UNUM_TYPE_3_VALID}")
    universal_status("  BUILD_APF                    :   ${BUILD_APF}")
    universal_status("")
    universal_status("  BUILD_C_API_LIB              :   ${BUILD_C_API_LIB}")
    universal_status("")
    universal_status("  BUILD_CMD_LINE_TOOLS         :   ${BUILD_CMD_LINE_TOOLS}")
    universal_status("  BUILD_EDUCATION_EXAMPLES     :   ${BUILD_EDUCATION_EXAMPLES}")
    universal_status("  BUILD_APPLICATION_EXAMPLES   :   ${BUILD_APPLICATION_EXAMPLES}")
    universal_status("  BUILD_PLAYGROUND             :   ${BUILD_PLAYGROUND}")
    universal_status("")
    universal_status("  BUILD_PERF_TESTS             :   ${BUILD_PERF_TESTS}")
    universal_status("")
    universal_status("  BUILD_IEEE_FLOAT_QUIRES      :   ${BUILD_IEEE_FLOAT_QUIRES}")
    universal_status("")
    universal_status("  BUILD_DOCS                   :   ${BUILD_DOCS}")
    universal_status("")
    universal_status("Dependencies:")
    universal_status("  SSE3                         : " USE_SSE3 AND COMPILER_HAS_SSE3_FLAG THEN "Yes" ELSE "No")
    universal_status("  AVX                          : " USE_AVX AND COMPILER_HAS_AVX_FLAG THEN "Yes" ELSE "No")
    universal_status("  AVX2                         : " USE_AVX2 AND COMPILER_HAS_AVX2_FLAG THEN "Yes" ELSE "No")
    universal_status("  Pthread                      : " USE_PTHREAD THEN "Yes" ELSE "No")
    universal_status("  TBB                          : " USE_TBB AND TBB_FOUND THEN "Yes (ver. ${TBB_INTERFACE_VERSION})" ELSE "No")
    universal_status("  OMP                          : " USE_OMP AND OMP_FOUND THEN "Yes" ELSE "No")
    #universal_status("  OpenCL                       : " USE_OPENCL AND OpenCL_FOUND THEN "Yes (ver. ${OpenCL_VERSION_STRING})" ELSE "No")
    universal_status("")
    universal_status("Utilities:")
    #universal_status("  OpenCV                       : " USE_OPENCV AND OpenCV_FOUND THEN "Yes (ver. ${OpenCV_VERSION})" ELSE "No")
    universal_status("  Serializer                   : " USE_SERIALIZER THEN "Yes" ELSE "No")
    #universal_status("  Image API                    : " USE_IMAGE_API THEN "Yes" ELSE "No")
    #universal_status("  Gemmlowp                     : " USE_GEMMLOWP THEN "Yes" ELSE "No")
    universal_status("")
    universal_status("Install:")
    universal_status("  Install path                 :   ${CMAKE_INSTALL_PREFIX}")
    universal_status("")
endfunction()
{'fraction_non_alphanumeric': 0.14685635612666362, 'fraction_numerical': 0.0030595074193054917, 'mean_word_length': 3.249268768280793, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '7288577', 'n_tokens_mistral': 4069, 'n_tokens_neox': 3898, 'n_words': 751}