def shift(data, shift=(0, 0, 0), mode="constant", interpolation="linear"):
    """
    translates 3d data by given amount
  
    
    Parameters
    ----------
    data: ndarray
        3d array
    shift : float or sequence
        The shift along the axes. If a float, `shift` is the same for each axis. 
        If a sequence, `shift` should contain one value for each axis.    
    mode: string 
        boundary mode, one of the following:      
        'constant'
            pads with zeros 
        'edge'
            pads with edge values
        'wrap'
            pads with the repeated version of the input 
    interpolation, string
        interpolation mode, one of the following       
        'linear'
        'nearest'
        
    Returns
    -------
    res: ndarray
        shifted array (same shape as input)
    """
    if np.isscalar(shift):
        shift = (shift,) * 3

    if len(shift) != 3:
        raise ValueError("shift (%s) should be of length 3!")

    shift = -np.array(shift)
    return affine(data, mat4_translate(*shift), mode=mode, interpolation=interpolation)