<commit_before>function overview(index)
	return (index[1], index[2], OVERVIEW_INDEX, OVERVIEW_INDEX);
end

function premontaged(index)
	return (index[1], index[2], PREMONTAGED_INDEX, PREMONTAGED_INDEX);
end

function montaged(index)
	return (index[1], index[2], MONTAGED_INDEX, MONTAGED_INDEX);
end

function prealigned(index)
	return (index[1], index[2], PREALIGNED_INDEX, PREALIGNED_INDEX);
end

function aligned(index)
	return (index[1], index[2], ALIGNED_INDEX, ALIGNED_INDEX);
end

function finished(index)
  return (index[1], index[2], FINISHED_INDEX, FINISHED_INDEX);
end
###

function overview(wafer, section)
	return (wafer, section, OVERVIEW_INDEX, OVERVIEW_INDEX);
end

function premontaged(wafer, section)
	return (wafer, section, PREMONTAGED_INDEX, PREMONTAGED_INDEX);
end

function montaged(wafer, section)
	return (wafer, section, MONTAGED_INDEX, MONTAGED_INDEX);
end

function prealigned(wafer, section)
	return (wafer, section, PREALIGNED_INDEX, PREALIGNED_INDEX);
end

function aligned(wafer, section)
	return (wafer, section, ALIGNED_INDEX, ALIGNED_INDEX);
end

function finished(wafer, section)
  return (wafer, section, FINISHED_INDEX, FINISHED_INDEX);
end

###

function is_overview(index)
    if index[3:4] == (OVERVIEW_INDEX, OVERVIEW_INDEX)   return true else return false end
end

function is_premontaged(index)
    if index[3] >= 0 && index[4] >= 0 return true else return false end
end

function is_montaged(index)
    if index[3:4] == (MONTAGED_INDEX, MONTAGED_INDEX)   return true else return false end
end

function is_prealigned(index)
    if index[3:4] == (PREALIGNED_INDEX, PREALIGNED_INDEX)   return true else return false end
end

function is_aligned(index)
    if index[3:4] == (ALIGNED_INDEX, ALIGNED_INDEX) return true else return false end
end

function is_finished(index)
    if index[3:4] == (FINISHED_INDEX, FINISHED_INDEX) return true else return false end
end

function is_adjacent(A_index, B_index)
  if !(is_premontaged(A_index)) || !(is_premontaged(B_index))	return false end
  if abs(A_index[3] - B_index[3]) + abs(A_index[4] - B_index[4])  == 1 return true; end
  return false;
end

function is_diagonal(A_index, B_index)
  if !(is_premontaged(A_index)) || !(is_premontaged(B_index))	return false end
  if abs(A_index[3] - B_index[3]) + abs(A_index[4] - B_index[4]) == 2 && A_index[3] != B_index[3] && A_index[4] != B_index[4] return true; end
  return false;
end

function is_preceding(A_index, B_index, within = 1)
  if (is_premontaged(A_index)) || (is_premontaged(B_index))	return false end
  	for i in 1:within
	if A_index[1:2] == get_preceding(B_index, i)[1:2] return true; end
      end
	return false;
end

function index_rank(index::Index)
  return index[1]*10^3 + index[2]
end

function isless(indexA::Index, indexB::Index)
  return Base.isless(index_rank(indexA), index_rank(indexB))
end

function isequal(indexA::Index, indexB::Index)
  return Base.isequal(index_rank(indexA), index_rank(indexB))
end

function get_overview_index(index)
  return (index[1:2]..., OVERVIEW_INDEX, OVERVIEW_INDEX)<commit_msg>Expand index_to_int for row and column sorting<commit_after>function overview(index)
	return (index[1], index[2], OVERVIEW_INDEX, OVERVIEW_INDEX);
end

function premontaged(index)
	return (index[1], index[2], PREMONTAGED_INDEX, PREMONTAGED_INDEX);
end

function montaged(index)
	return (index[1], index[2], MONTAGED_INDEX, MONTAGED_INDEX);
end

function prealigned(index)
	return (index[1], index[2], PREALIGNED_INDEX, PREALIGNED_INDEX);
end

function aligned(index)
	return (index[1], index[2], ALIGNED_INDEX, ALIGNED_INDEX);
end

function finished(index)
  return (index[1], index[2], FINISHED_INDEX, FINISHED_INDEX);
end
###

function overview(wafer, section)
	return (wafer, section, OVERVIEW_INDEX, OVERVIEW_INDEX);
end

function premontaged(wafer, section)
	return (wafer, section, PREMONTAGED_INDEX, PREMONTAGED_INDEX);
end

function montaged(wafer, section)
	return (wafer, section, MONTAGED_INDEX, MONTAGED_INDEX);
end

function prealigned(wafer, section)
	return (wafer, section, PREALIGNED_INDEX, PREALIGNED_INDEX);
end

function aligned(wafer, section)
	return (wafer, section, ALIGNED_INDEX, ALIGNED_INDEX);
end

function finished(wafer, section)
  return (wafer, section, FINISHED_INDEX, FINISHED_INDEX);
end

###

function is_overview(index)
    if index[3:4] == (OVERVIEW_INDEX, OVERVIEW_INDEX)   return true else return false end
end

function is_premontaged(index)
    if index[3] >= 0 && index[4] >= 0 return true else return false end
end

function is_montaged(index)
    if index[3:4] == (MONTAGED_INDEX, MONTAGED_INDEX)   return true else return false end
end

function is_prealigned(index)
    if index[3:4] == (PREALIGNED_INDEX, PREALIGNED_INDEX)   return true else return false end
end

function is_aligned(index)
    if index[3:4] == (ALIGNED_INDEX, ALIGNED_INDEX) return true else return false end
end

function is_finished(index)
    if index[3:4] == (FINISHED_INDEX, FINISHED_INDEX) return true else return false end
end

function is_adjacent(A_index, B_index)
  if !(is_premontaged(A_index)) || !(is_premontaged(B_index))	return false end
  if abs(A_index[3] - B_index[3]) + abs(A_index[4] - B_index[4])  == 1 return true; end
  return false;
end

function is_diagonal(A_index, B_index)
  if !(is_premontaged(A_index)) || !(is_premontaged(B_index))	return false end
  if abs(A_index[3] - B_index[3]) + abs(A_index[4] - B_index[4]) == 2 && A_index[3] != B_index[3] && A_index[4] != B_index[4] return true; end
  return false;
end

function is_preceding(A_index, B_index, within = 1)
  if (is_premontaged(A_index)) || (is_premontaged(B_index))	return false end
  	for i in 1:within
	if A_index[1:2] == get_preceding(B_index, i)[1:2] return true; end
      end
	return false;
end

function index_rank(index::Index)
  return index[1]*10^3 + index[2]
end

function index_to_int(index::Index)
  return index[1]*10^7 + index[2]*10^4 + index[3]*10^2 + index[4] 
end

function isless(indexA::Index, indexB::Index)
  return Base.isless(index_rank(indexA), index_rank(indexB))
end

function isequal(indexA::Index, indexB::Index)
  return Base.isequal(index_rank(indexA), index_rank(indexB))
end

function get_overview_index(index)
  return (index[1:2]..., OVERVIEW_INDEX, OVERVIEW_INDEX)
{'fraction_non_alphanumeric': 0.11911975761441557, 'fraction_numerical': 0.018976239834157232, 'mean_word_length': 6.31002331002331, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2676171', 'n_tokens_mistral': 2359, 'n_tokens_neox': 2290, 'n_words': 571}