<commit_before>if(NOT USE_PYTHON_SUBMODULE)

	if(DEFINED PYTHON_HOME)
		set(PYTHON_HOME ${PYTHON_HOME} CACHE PATH ${PYTHON_HOME_INSTRUCTIONS})
	else()
		set(PYTHON_HOME "/usr" CACHE PATH ${PYTHON_HOME_INSTRUCTIONS})
	endif()

	#find python headers
	file(GLOB_RECURSE PYTHON_H ${CMAKE_FIND_ROOT_PATH}/${PYTHON_HOME}/*Python.h)
	if(PYTHON_H)
		message("Found Python.h using CMAKE_FIND_ROOT_PATH")
		set(TOP_INCLUDE ${CMAKE_FIND_ROOT_PATH}/${PYTHON_HOME}/include)
	else()
		set(TOP_INCLUDE ${PYTHON_HOME}/include)
		file(GLOB_RECURSE PYTHON_H ${PYTHON_HOME}/*Python.h)
	endif()
	message("Globbed '${PYTHON_H}'")
	string(REGEX MATCH "([^;]*)[/]+include[/]+(python3.([0-9])+)m" PYTHON_VER "${PYTHON_H}")
	if(PYTHON_VER)
		set(PYTHON_HOME_DISCOVERED ${CMAKE_MATCH_1})
		set(PYTHON_VER ${CMAKE_MATCH_2})
		set(PYTHON_MINOR_VER ${CMAKE_MATCH_3})
		message("Version string: ${PYTHON_VER}")
		if(PYTHON_HOME_DISCOVERED EQUAL PYTHON_HOME)
			message("PYTHON_HOME confirmed")
		else()
			message("Warning: resetting PYTHON_HOME to ${PYTHON_HOME_DISCOVERED}")
			set(PYTHON_HOME ${PYTHON_HOME_DISCOVERED})
		endif()
	endif()

	find_path(PYTHON_INCLUDE_DIRS Python.h
		PATHS ${PYTHON_HOME}/include/${PYTHON_VER}m
		NO_DEFAULT_PATH
		CMAKE_FIND_ROOT_PATH_BOTH)

	if(PYTHON_INCLUDE_DIRS)
		message("Python headers found: ${PYTHON_INCLUDE_DIRS}")
	else()
		message(FATAL_ERROR "Can't find Python headers in ${PYTHON_HOME}" )
	endif()

	set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${TOP_INCLUDE})

	string(REGEX MATCH "3[0-9]+" PYTHON_NUM "${PYTHON_INCLUDE_DIRS}")

	if(PYTHON_NUM OR PYTHON_MINOR_VER)
		if(PYTHON_NUM)
			message("Python version number ${PYTHON_NUM}")
		endif()
		if(PYTHON_MINOR_VER)<commit_msg>broke header search in windows<commit_after>if(NOT USE_PYTHON_SUBMODULE)

	if(DEFINED PYTHON_HOME)
		set(PYTHON_HOME ${PYTHON_HOME} CACHE PATH ${PYTHON_HOME_INSTRUCTIONS})
	else()
		set(PYTHON_HOME "/usr" CACHE PATH ${PYTHON_HOME_INSTRUCTIONS})
	endif()

	#find python headers
	file(GLOB_RECURSE PYTHON_H ${CMAKE_FIND_ROOT_PATH}/${PYTHON_HOME}/*Python.h)
	if(PYTHON_H)
		message("Found Python.h using CMAKE_FIND_ROOT_PATH")
		set(TOP_INCLUDE ${CMAKE_FIND_ROOT_PATH}/${PYTHON_HOME}/include)
	else()
		set(TOP_INCLUDE ${PYTHON_HOME}/include)
		file(GLOB_RECURSE PYTHON_H ${PYTHON_HOME}/*Python.h)
	endif()
	message("Globbed '${PYTHON_H}'")
	string(REGEX MATCH "([^;]*)[/]+include[/]+(python3.([0-9])+)m" PYTHON_VER "${PYTHON_H}")
	if(PYTHON_VER)
		set(PYTHON_HOME_DISCOVERED ${CMAKE_MATCH_1})
		set(PYTHON_VER ${CMAKE_MATCH_2})
		set(PYTHON_MINOR_VER ${CMAKE_MATCH_3})
		message("Version string: ${PYTHON_VER}")
		if(PYTHON_HOME_DISCOVERED EQUAL PYTHON_HOME)
			message("PYTHON_HOME confirmed")
		else()
			message("Warning: resetting PYTHON_HOME to ${PYTHON_HOME_DISCOVERED}")
			set(PYTHON_HOME ${PYTHON_HOME_DISCOVERED})
		endif()
	endif()

	find_path(PYTHON_INCLUDE_DIRS Python.h
		PATHS ${PYTHON_HOME}/include/${PYTHON_VER}m ${PYTHON_HOME}/include/
		NO_DEFAULT_PATH
		CMAKE_FIND_ROOT_PATH_BOTH)

	if(PYTHON_INCLUDE_DIRS)
		message("Python headers found: ${PYTHON_INCLUDE_DIRS}")
	else()
		message(FATAL_ERROR "Can't find Python headers in ${PYTHON_HOME}" )
	endif()

	set(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIRS} ${TOP_INCLUDE})

	string(REGEX MATCH "3[0-9]+" PYTHON_NUM "${PYTHON_INCLUDE_DIRS}")

	if(PYTHON_NUM OR PYTHON_MINOR_VER)
		if(PYTHON_NUM)
			message("Python version number ${PYTHON_NUM}")
		endif()
		if(PYTHON_MINOR_VER)
{'fraction_non_alphanumeric': 0.13878382310154205, 'fraction_numerical': 0.00523712540005819, 'mean_word_length': 7.264423076923077, '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': '2980594', 'n_tokens_mistral': 1631, 'n_tokens_neox': 1481, 'n_words': 216}