def int2tokens(num, tokens, negative_sign='-'):
    """
    Convert a group of tokens (within a given set) to a number.

    Items in the tokens set must not repeat/overlap.

    This is the inverse of `int2tokens()` given the same tokens set.

    Args:
        num (int): The input number to convert.
        tokens (Iterable[str]): The tokens to use for the representation.
            Items within the tokens set must not repeat or overlap.
        negative_sign (str): The symbol to use for negative numbers.
            The negative sign will be the first character of the
            representation.

    Returns:
        text (str): The integer represented.

    Examples:
        >>> [int2tokens(i, ('0', '1')) for i in range(10)]
        ['0', '1', '00', '01', '10', '11', '000', '001', '010', '011']
        >>> [int2tokens(i, ('a', 'b', 'c')) for i in range(10)]
        ['a', 'b', 'c', 'aa', 'ab', 'ac', 'ba', 'bb', 'bc', 'ca']
        >>> [int2tokens(i, 'abc') for i in range(10)]
        ['a', 'b', 'c', 'aa', 'ab', 'ac', 'ba', 'bb', 'bc', 'ca']
        >>> [int2tokens(i, ('po', 'ta')) for i in range(8)]
        ['po', 'ta', 'popo', 'pota', 'tapo', 'tata', 'popopo', 'popota']
        >>> int2tokens(161, ('po', 'ta'))
        'potapopopotata'
        >>> d = ('mo', 'no', 'ke')
        >>> all(n == tokens2int(int2tokens(n, d), d) for n in range(-999, 99))
        True

    See Also:
        letter2int(), int2letter(), tokens2int()
    """
    text = ''
    if num < 0:
        sign_text = negative_sign
        num = abs(num)
    else:
        sign_text = ''
    while num >= 0:
        text = tokens[num % len(tokens)] + text
        num = num // len(tokens) - 1
    return sign_text + text
