<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _fftshift_single(d_g, res_g, ax = 0):
 """ basic fftshift of an OCLArray = [N1, N, N2] the we can address each element in the flat buffer by index = i + N2*j + N2*N*k where i = 1 .. N2 j = 1 .. N k = 1 .. N1 and the swap of elements is performed on the index j """


    dtype_kernel_name = {np.float32:"fftshift_1_f",
                   np.complex64:"fftshift_1_c"
                   }

    N = d_g.shape[ax]
    N1 = 1 if ax==0 else np.prod(d_g.shape[:ax])
    N2 = 1 if ax == len(d_g.shape)-1 else np.prod(d_g.shape[ax+1:])

    dtype = d_g.dtype.type

    prog = OCLProgram(abspath("kernels/fftshift.cl"))
    prog.run_kernel(dtype_kernel_name[dtype],(N2,N//2,N1),None,
                    d_g.data, res_g.data,
                    np.int32(N),
                    np.int32(N2))


    return res_g