code: def convert_2d_to_3d(arrays, num_channels=3):
      # Converts a 2D numpy array with shape (H, W) into a 3D array with shape (H, W, num_channels)
      # by repeating the existing values along the new axis.
      arrays = tuple(
          np.repeat(
              array[:, :, np.newaxis], repeats=num_channels, axis=2
          )
          for array in arrays
      )
      if len(arrays) == 1:
          return arrays[0]
      return arrays
  
imports: import inspect
  import random
  import typing
  from io import StringIO
  from typing import Optional, Set, Type
  import numpy
  import albumentations
label_desc: Use image node_id 1 for calling a global function with example usage: convert_2d_to_3d(arrays, num_channels) and returns: arrays, arrays