def METHOD_NAME():
    """
    Returns a pair of enumeration functions rank / unrank.
    rank assigns on the fly an integer, starting from 0, to any object
    passed as argument. The object should be hashable. unrank is the
    inverse function; it returns None for indices that have not yet
    been assigned.
    EXAMPLES::
        sage: [rank, unrank] = sage.combinat.ranker.on_fly()
        sage: rank('a')
        0
        sage: rank('b')
        1
        sage: rank('c')
        2
        sage: rank('a')
        0
        sage: unrank(2)
        'c'
        sage: unrank(3)
        sage: rank('d')
        3
        sage: unrank(3)
        'd'
    .. TODO:: add tests as in combinat::rankers
    """
    def count():
        i = 0
        while True:
            yield i
            i += 1
    counter = count()
    @cached_function
    def rank(x):
        i = next(counter)
        unrank.set_cache(x, i)
        return i
    @cached_function
    def unrank(i):
        return None
    return [rank, unrank]