code: def convert_3d_to_2d_generator(data_dict):
      shp = data_dict["data"].shape
      data_dict["data"] = data_dict["data"].reshape(
          (shp[0], shp[1] * shp[2], shp[3], shp[4])
      )
      data_dict["orig_shape_data"] = shp
      shp = data_dict["seg"].shape
      data_dict["seg"] = data_dict["seg"].reshape(
          (shp[0], shp[1] * shp[2], shp[3], shp[4])
      )
      data_dict["orig_shape_seg"] = shp
      return data_dict
  
imports: import random
  import numpy
  import paddle
  from paddle.nn.functional import avg_pool2d, avg_pool3d
  from typing import List, Tuple, Union, Callable
  from copy import deepcopy
  from scipy.ndimage import map_coordinates, fourier_gaussian
  from scipy.ndimage.filters import gaussian_filter, gaussian_gradient_magnitude
  from scipy.ndimage.morphology import grey_dilation
  from skimage.transform import resize
  from scipy.ndimage.measurements import label
label_desc: Use image node_id 32 for calling a global function with example usage: convert_3d_to_2d_generator(data_dict) and returns: data_dict