def jaccard(u, v):
u = _validate_vector(u)<EOL>v = _validate_vector(v)<EOL>dist = (np.double(np.bitwise_and((u != v),<EOL>np.bitwise_or(u != <NUM_LIT:0>, v != <NUM_LIT:0>)).sum())<EOL>/ np.double(np.bitwise_or(u != <NUM_LIT:0>, v != <NUM_LIT:0>).sum()))<EOL>return dist<EOL>
Computes the Jaccard-Needham dissimilarity between two boolean 1-D arrays.

The Jaccard-Needham dissimilarity between 1-D boolean arrays `u` and `v`,
is defined as

.. math::

   \\frac{c_{TF} + c_{FT}}
        {c_{TT} + c_{FT} + c_{TF}}

where :math:`c_{ij}` is the number of occurrences of
:math:`\\mathtt{u[k]} = i` and :math:`\\mathtt{v[k]} = j` for
:math:`k < n`.

Parameters
----------
u : (N,) array_like, bool
    Input array.
v : (N,) array_like, bool
    Input array.

Returns
-------
jaccard : double
    The Jaccard distance between vectors `u` and `v`.