def get_type(g):
    """
    Returns the rotation type of each quaternion present in the input quaternion array.

    Parameters
    ----------
    g: numpy.array
        a quaternion array of size (5 x n)

    Returns
    -------
    integer values (either +1 or -1) stored in a 1-D numpy array of size n.
        +1 is returned for proper rotations
        -1 is returned for improper rotations
    """
    if g.ndim == 1:
        return g[4]
    else:
        return g[4, :]