def _ainvhash(anum,num_of_arrows,dim):
    """Turns an arrow hash back into the array of arrow directions.

    Args:
        anum (int): The arrow hash number.
        num_of_arrows (int): The number of arrows in the system.
        dim (int): The number of directions the arrows can point.

    Returns:
        arrows (list): The arrow labeling.
    """
    arrows = [0]*num_of_arrows
    for i in range(num_of_arrows):
        base = dim**(num_of_arrows-1-i)
        arrows[num_of_arrows-1-i] = anum//base
        anum -= base*arrows[num_of_arrows-1-i]
    return(arrows)