code: def trim_floating_solid(im):
      r
      im = sp.copy(im)
      holes = find_disconnected_voxels(~im)
      im[holes] = True
      return im
docs: r"""
      Removes all solid that that is not attached to the edges of the image.
  
      Parameters
      ----------
      im : ND-array
          The image of the porous material
  
      Returns
      -------
      image : ND-array
          A version of ``im`` but with all the disconnected solid removed.
  
      See Also
      --------
      find_disconnected_voxels