code: def expand(labels, distance):
      """
      Expand labels by a specified distance.
      """
  
      background = labels == 0
  
      distances, (i, j) = scipy.ndimage.distance_transform_edt(
          background, return_indices=True
      )
  
      out_labels = labels.copy()
  
      mask = background & (distances <= distance)
  
      out_labels[mask] = labels[i[mask], j[mask]]
  
      return out_labels
  
imports: from typing import Literal
  import centrosome.cpmorphology
  import numpy
  import scipy.ndimage
  import skimage.morphology
  import mahotas
label_desc: Use image node_id 6 for calling a global function with example usage: expand(labels, distance) and returns: out_labels