<commit_before>#GLOBALS
#=======
FIRST_IDX = 0

def chop(number, int_list):
	list_size = length(int_list)
	start_idx = FIRST_IDX
	end_idx = list_size-1
	current_idx = end_idx/2
	itr_counter = list_size
	while itr_counter>0:
		current_value = int_list[current_idx]
			if current_value == number:
				return current_idx
			else if current_value > number:
				end_idx = current_idx - 1
			else if current_value < number:
				start_idx = current_idx+1

			current_idx = (end_idx + start_idx)/2
			itr_counter /=2
			
	if __name__=="__main__":
	<commit_msg>add test<commit_after>#GLOBALS
#=======
FIRST_IDX = 0

def chop(number, int_list):
	list_size = len(int_list)
	start_idx = FIRST_IDX
	end_idx = list_size-1
	current_idx = end_idx/2
	itr_counter = list_size
	while itr_counter>0:
		current_value = int_list[current_idx]
		if current_value == number:
			return current_idx
		elif current_value > number:
			end_idx = current_idx - 1
		elif current_value < number:
			start_idx = current_idx+1

		current_idx = (end_idx + start_idx)/2
		itr_counter /=2
		
	return -1
			
def test_chop():
	print(-1, chop(3, []))
	print(-1, chop(3, [1]))
	print(0,  chop(1, [1, 3, 5]))
	print(1,  chop(3, [1, 3, 5]))
	print(2,  chop(5, [1, 3, 5]))
	print(-1, chop(0, [1, 3, 5]))
	print(-1, chop(2, [1, 3, 5]))
	print(-1, chop(4, [1, 3, 5]))
	print(-1, chop(6, [1, 3, 5]))
	print(0,  chop(1, [1, 3, 5, 7]))
	print(1,  chop(3, [1, 3, 5, 7]))
	print(2,  chop(5, [1, 3, 5, 7]))
	print(3,  chop(7, [1, 3, 5, 7]))
	print(-1, chop(0, [1, 3, 5, 7]))
	print(-1, chop(2, [1, 3, 5, 7]))
	print(-1, chop(4, [1, 3, 5, 7]))
	print(-1, chop(6, [1, 3, 5, 7]))
	print(-1, chop(8, [1, 3, 5, 7]))
  
  
if __name__ == "__main__":
	test_chop()
{'fraction_non_alphanumeric': 0.182031708749266, 'fraction_numerical': 0.06517909571344686, 'mean_word_length': 3.773109243697479, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 7, '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': '313952', 'n_tokens_mistral': 847, 'n_tokens_neox': 763, 'n_words': 189}