def temporalID_to_snapnum(temporalID, index_mult_factor):
    """
    Given a temporalID, return the corresponding snapshot number.

    Parameters
    ----------

    ID: array-like of integers, or integer.
        Array or single value that describes the temporalID/s.

    index_mult_factor: integer.
        Factor to convert to from temporally-unique halo ID to snap-shot unique
        halo index.

    Returns
    ----------

    snapnum: array-like of integers, or integer.
        Array or single value that contains the snapshot number corresponding
        to the temporal ID.

    Examples
    ----------

    >>> temporalID_to_snapnum(-1, 1e12)
    0

    >>> temporalID_to_snapnum(18000000000001, 1e12)
    18

    >>> test_list = [18000000000001, 20000000000050, 134000000000005]
    >>> temporalID_to_snapnum(test_list, 1e12)
    array([ 18,  20, 134])


    >>> import numpy as np
    >>> test_array = np.array([20000000000050, 134000000000005])
    >>> temporalID_to_snapnum(test_array, 1e12)
    array([ 20, 134])
    """
    import numpy as np
    if isinstance(temporalID, list) or isinstance(temporalID, np.ndarray):
        snapnum = (np.subtract(temporalID, 1) / index_mult_factor).astype(int)
    else:
        snapnum = int((temporalID - 1) / index_mult_factor)
    return snapnum
