<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def trim_disconnected_blobs(im, inlets):
 r""" Removes foreground voxels not connected to specified inlets Parameters im : ND-array The array to be trimmed inlets : ND-array of tuple of indices The locations of the inlets. Any voxels *not* connected directly to the inlets will be trimmed Returns ------- image : ND-array An array of the same shape as ``im``, but with all foreground voxels not connected to the ``inlets`` removed. """

    temp = sp.zeros_like(im)
    temp[inlets] = True
    labels, N = spim.label(im + temp)
    im = im ^ (clear_border(labels=labels) > 0)
    return im