def hashes_are_similar(left_hash, right_hash, tolerance=6): """ Return True if the hamming distance between the image hashes are less than the given tolerance. """ return hash_distance(left_hash, right_hash) <= tolerance