def __interpolate_patch_shape(data_shape, desired_patch_shape):
    """
    Given desired patch shape to extract (i.e. patch considered at last axes),
    fills the preceeding dimensions with ones, based on the data shape.
    Used for patch extractor

    Example
    -------
    data_shape (1, 2, 30, 256, 256),
    desired_patch_shape (16, 16)
        --> returns (1, 1, 1, 16, 16)

    """
    n = len(data_shape)
    np = len(desired_patch_shape)
    new_patch_shape = (1, ) * (n - np) + desired_patch_shape
    return new_patch_shape