def dist_abs(<EOL>self, src, tar, weights='<STR_LIT>', max_length=<NUM_LIT:8>, normalized=False<EOL>):
<EOL>xored = eudex(src, max_length=max_length) ^ eudex(<EOL>tar, max_length=max_length<EOL>)<EOL>if not weights:<EOL><INDENT>binary = bin(xored)<EOL>distance = binary.count('<STR_LIT:1>')<EOL>if normalized:<EOL><INDENT>return distance / (len(binary) - <NUM_LIT:2>)<EOL><DEDENT>return distance<EOL><DEDENT>if callable(weights):<EOL><INDENT>weights = weights()<EOL><DEDENT>elif weights == '<STR_LIT>':<EOL><INDENT>weights = Eudex.gen_exponential()<EOL><DEDENT>elif weights == '<STR_LIT>':<EOL><INDENT>weights = Eudex.gen_fibonacci()<EOL><DEDENT>if isinstance(weights, GeneratorType):<EOL><INDENT>weights = [next(weights) for _ in range(max_length)][::-<NUM_LIT:1>]<EOL><DEDENT>distance = <NUM_LIT:0><EOL>max_distance = <NUM_LIT:0><EOL>while (xored or normalized) and weights:<EOL><INDENT>max_distance += <NUM_LIT:8> * weights[-<NUM_LIT:1>]<EOL>distance += bin(xored & <NUM_LIT>).count('<STR_LIT:1>') * weights.pop()<EOL>xored >>= <NUM_LIT:8><EOL><DEDENT>if normalized:<EOL><INDENT>distance /= max_distance<EOL><DEDENT>return distance<EOL>
Calculate the distance between the Eudex hashes of two terms.

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison
        weights : str, iterable, or generator function
            The weights or weights generator function

                - If set to ``None``, a simple Hamming distance is calculated.
                - If set to ``exponential``, weight decays by powers of 2, as
                  proposed in the eudex specification:
                  https://github.com/ticki/eudex.
                - If set to ``fibonacci``, weight decays through the Fibonacci
                  series, as in the eudex reference implementation.
                - If set to a callable function, this assumes it creates a
                  generator and the generator is used to populate a series of
                  weights.
                - If set to an iterable, the iterable's values should be
                  integers and will be used as the weights.

        max_length : int
            The number of characters to encode as a eudex hash
        normalized : bool
            Normalizes to [0, 1] if True

        Returns
        -------
        int
            The Eudex Hamming distance

        Examples
        --------
        >>> cmp = Eudex()
        >>> cmp.dist_abs('cat', 'hat')
        128
        >>> cmp.dist_abs('Niall', 'Neil')
        2
        >>> cmp.dist_abs('Colin', 'Cuilen')
        10
        >>> cmp.dist_abs('ATCG', 'TAGC')
        403

        >>> cmp.dist_abs('cat', 'hat', weights='fibonacci')
        34
        >>> cmp.dist_abs('Niall', 'Neil', weights='fibonacci')
        2
        >>> cmp.dist_abs('Colin', 'Cuilen', weights='fibonacci')
        7
        >>> cmp.dist_abs('ATCG', 'TAGC', weights='fibonacci')
        117

        >>> cmp.dist_abs('cat', 'hat', weights=None)
        1
        >>> cmp.dist_abs('Niall', 'Neil', weights=None)
        1
        >>> cmp.dist_abs('Colin', 'Cuilen', weights=None)
        2
        >>> cmp.dist_abs('ATCG', 'TAGC', weights=None)
        9

        >>> # Using the OEIS A000142:
        >>> cmp.dist_abs('cat', 'hat', [1, 1, 2, 6, 24, 120, 720, 5040])
        1
        >>> cmp.dist_abs('Niall', 'Neil', [1, 1, 2, 6, 24, 120, 720, 5040])
        720
        >>> cmp.dist_abs('Colin', 'Cuilen',
        ... [1, 1, 2, 6, 24, 120, 720, 5040])
        744
        >>> cmp.dist_abs('ATCG', 'TAGC', [1, 1, 2, 6, 24, 120, 720, 5040])
        6243