def _convert_patches_list_to_single_array(patches_list, n_center):
    r"""
    Converts patches from a `list` of :map:`Image` objects to a single `ndarray`
    with shape ``(n_center, n_offset, self.n_channels, patch_shape)``.

    Note that these two are the formats returned by the `extract_patches()`
    and `extract_patches_around_landmarks()` methods of :map:`Image` class.

    Parameters
    ----------
    patches_list : `list` of `n_center * n_offset` :map:`Image` objects
        A `list` that contains all the patches as :map:`Image` objects.
    n_center : `int`
        The number of centers from which the patches are extracted.

    Returns
    -------
    patches_array : `ndarray` ``(n_center, n_offset, n_channels, patch_shape)``
        The numpy array that contains all the patches.
    """
    n_offsets = np.int(n_center / len(patches_list))
    n_channels = patches_list[0].n_channels
    height = patches_list[0].height
    width = patches_list[0].width
    patches_array = np.empty((n_center, n_offsets, n_channels, height, width),
                             dtype=patches_list[0].pixels.dtype)
    total_index = 0
    for p in range(n_center):
        for o in range(n_offsets):
            patches_array[p, o, ...] = patches_list[total_index].pixels
            total_index += 1
    return patches_array
dataset/ETHPy150Open menpo/menpo/menpo/image/base.py/_convert_patches_list_to_single_array/swapped operands of `/`