def sequence_info(a_list):
    """
    Provides a reverse lookup for any sortable list.

    Parameters
    ----------
    a_list : list
        The items to be put in sequence. A list, or any indexable collection of sortable values.

    Returns
    -------
    seq : list of integers
        The indices of the original list, in ascending order of value.
    ranks : TYPE
        The ranks of each value in the original list.

    """
    seq = [(i,a_list[i]) for i in range(len(a_list))]
    seq.sort(key = lambda x:x[1])
    seq = [x[0] for x in seq]
    ranks = [-1]*len(seq)
    for i in range(len(seq)):
        ranks[seq[i]]=i
    return seq,ranks