<commit_before>type Matches
  src_index          # source mesh index
  dst_index          # destination mesh index

  src_points::Points	    # destination point coordinate in image
  dst_points::Points        # destination point coordinate in image
end
#=
function review_match_log(Ms, k)
       inds = Ms.matches_pairs[k];
       src = Ms.meshes[inds[1]];
       dst = Ms.meshes[inds[2]];
       src_im, src_off = meshwarp(src);
       dst_im, dst_off = meshwarp(dst);
       off = dst_off - src_off;
       if off[1] > 0
	  o1_i = off[1]:size(src_im, 1);
	  o2_i = 1:length(o1_i);
	else
	  o2_i = -off[1]:size(dst_im, 1);
	  o1_i = 1:length(o2_i);
	end
       if off[2] > 0
	  o1_j = off[2]:size(src_im, 2);
	  o2_j = 1:length(o1_j);
	else
	  o2_j = -off[2]:size(dst_im, 2);
	  o1_j = 1:length(o2_j);
	end
       
       o1 = src_im[o1_i, o1_j] * 255;
       o2 = dst_im[o2_i, o2_j] * 255;
       view(imfilter_LoG(o1 - o2, 5), pixelspacing = [1, 1]);
  end
=#

# retrieve the ranges, only works with UInt8
function get_patch(img, range)
	range_in_img = intersect(range[1], 1:size(img)[1]), intersect(range[2], 1:size(img)[2]);

	# if the image is fully contained, then return the intersection - otherwise find location and pad by mean
	if length(range_in_img[1]) == length(range[1]) && length(range_in_img[2]) == length(range[2])
		return img[range_in_img...];
	else
		indices_within_range = findin(range[1], range_in_img[1])
		intersect_img = img[range_in_img...];
	end
end

function get_range(pt, src_mesh, dst_mesh, params)
	get_range(pt, src_mesh, dst_mesh, params["block_size"], params["search_r"]);
end

function get_range(pt, src_mesh, dst_mesh, block_size, search_r)
	# convert to local coordinates in both src / dst images, and then round up to an integer
	src_pt = pt - get_offsets(src_mesh);
	src_pt = ceil(Int64, src_pt);
	dst_pt = pt - get_offsets(dst_mesh);
	dst_pt = ceil(Int64, dst_pt);

	block_range = -block_size:block_size;
	search_range = -(block_size+search_r):(block_size+search_r);

	src_range = src_pt[1] + block_range, src_pt[2] + block_range;
	dst_range = dst_pt[1] + search_range, dst_pt[2] + search_range;<commit_msg>moving matches to type_revisions<commit_after>type Matches
  src_index          # source mesh index
  dst_index          # destination mesh index

  src_points::Points	    # destination point coordinate in image
  dst_points::Points        # destination point coordinate in image
end
#=
function review_match_log(Ms, k)
       inds = Ms.matches_pairs[k];
       src = Ms.meshes[inds[1]];
       dst = Ms.meshes[inds[2]];
       src_im, src_off = meshwarp(src);
       dst_im, dst_off = meshwarp(dst);
       off = dst_off - src_off;
       if off[1] > 0
	  o1_i = off[1]:size(src_im, 1);
	  o2_i = 1:length(o1_i);
	else
	  o2_i = -off[1]:size(dst_im, 1);
	  o1_i = 1:length(o2_i);
	end
       if off[2] > 0
	  o1_j = off[2]:size(src_im, 2);
	  o2_j = 1:length(o1_j);
	else
	  o2_j = -off[2]:size(dst_im, 2);
	  o1_j = 1:length(o2_j);
	end
       
       o1 = src_im[o1_i, o1_j] * 255;
       o2 = dst_im[o2_i, o2_j] * 255;
       view(imfilter_LoG(o1 - o2, 5), pixelspacing = [1, 1]);
  end
=#

# retrieve the ranges, only works with UInt8
function get_patch(img, range)
	range_in_img = intersect(range[1], 1:size(img)[1]), intersect(range[2], 1:size(img)[2]);

	# if the image is fully contained, then return the intersection - otherwise find location and pad by mean
	if length(range_in_img[1]) == length(range[1]) && length(range_in_img[2]) == length(range[2])
		return img[range_in_img...];
	else
		indices_within_range = findin(range[1], range_in_img[1])
		intersect_img = img[range_in_img...];
		avg = 
	end
end

function get_range(pt, src_mesh, dst_mesh, params)
	get_range(pt, src_mesh, dst_mesh, params["block_size"], params["search_r"]);
end

function get_range(pt, src_mesh, dst_mesh, block_size, search_r)
	# convert to local coordinates in both src / dst images, and then round up to an integer
	src_pt = pt - get_offsets(src_mesh);
	src_pt = ceil(Int64, src_pt);
	dst_pt = pt - get_offsets(dst_mesh);
	dst_pt = ceil(Int64, dst_pt);

	block_range = -block_size:block_size;
	search_range = -(block_size+search_r):(block_size+search_r);

	src_range = src_pt[1] + block_range, src_pt[2] + block_range;
	dst_range = dst_pt[1] + search_range, dst_pt[2] + search_range;
{'fraction_non_alphanumeric': 0.13390379278445882, 'fraction_numerical': 0.03145235892691952, 'mean_word_length': 3.821627647714604, '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': '2043228', 'n_tokens_mistral': 1799, 'n_tokens_neox': 1699, 'n_words': 387}