tractVector{Int}, metric, _)
    distance = @inbounds evaluate(metric, view(x, :, idx[1]), view(y, :, idx[2]))
    return (distance &gt; thresholds[1] &amp;&amp; distance &lt;= thresholds[2])
end</code></pre><p>Note that the only difference between them is the <code>thresholds</code> parameter, which is a <code>Tuple{Float64, Float64}</code> instead of a single <code>Float64</code>. This is because it is a free parameter that can be adapted to your specific use case. So, if you implement a different recurre