def _slice_at_axis(shape, sl, axis):
    """
    Construct a slice tuple the length of shape, with sl at the specified axis
    """
    slice_tup = (slice(None),)
    return slice_tup * axis + (sl,) + slice_tup * (len(shape) - axis - 1)