<commit_before># cmake file

include(FindPackageHandleStandardArgs)
include(FindPythonInterp)

function(find_python_module name)
  set(pkg_name "PY_${name}")
  string(TOUPPER "${pkg_name}" module)

  set(result FALSE)

  # a module's location is usually a directory,
  # but for binary modules it's a .so file
  set(prg_str "import re, ${name}; \
  print re.compile('/__init__.py.*').sub('',${name}.__file__)")

  if(PYTHONINTERP_FOUND)
    execute_process(COMMAND
      ${PYTHON_EXECUTABLE} "-c" "${prg_str}"
      RESULT_VARIABLE result
      OUTPUT_VARIABLE location
      ERROR_QUIET
      OUTPUT_STRIP_TRAILING_WHITESPACE)
  else()
    message(WARNING "Could not find Python interpreter")
  endif()

  if(NOT result)
    message(STATUS "location ${location} of Python module: ${module}")
    set(${module} ${location} CACHE STRING "Location of Python module: ${name}")
  endif()

  find_package_handle_standard_args(${pkg_name} DEFAULT_MSG ${module})
endfunction()
<commit_msg>fix external process execution and variable setting<commit_after># cmake file

include(FindPackageHandleStandardArgs)
include(FindPythonInterp)

function(find_python_module name)
  set(pkg_name "PY_${name}")
  string(TOUPPER "${pkg_name}" module)

  set(result FALSE)

  # a module's location is usually a directory,
  # but for binary modules it's a .so file
  set(prg_str "import re, ${name}; \
  print re.compile('/__init__.py.*').sub('',${name}.__file__)")

  if(PYTHONINTERP_FOUND)
    execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "${prg_str}"
      RESULT_VARIABLE result
      OUTPUT_VARIABLE location
      ERROR_QUIET
      OUTPUT_STRIP_TRAILING_WHITESPACE)
  else()
    message(WARNING "Could not find Python interpreter")
  endif()

  if(NOT result)
    message(STATUS "location '${location}' of Python module: ${module}")
    set(${module} ${location})
    set(${module} ${location} CACHE STRING "Location of Python module: ${name}")
  endif()

  find_package_handle_standard_args(${pkg_name} DEFAULT_MSG ${module})
endfunction()

{'fraction_non_alphanumeric': 0.12530833744449926, 'fraction_numerical': 0.0, 'mean_word_length': 4.912536443148688, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6983192', 'n_tokens_mistral': 679, 'n_tokens_neox': 656, 'n_words': 162}