code: def remove_regions(labeled, regions, inplace=False):
      """
      removed = remove_regions(labeled, regions, inplace=False):
  
      Removes the regions in ``regions``. If an elementwise ``in`` operator
      existed, this would be equivalent to the following::
  
          labeled[ labeled element-wise-in regions ] = 0
  
      This function **does not** relabel its arguments. You can use the
      ``relabel`` function for that::
  
          removed = relabel(remove_regions(labeled, regions))
  
      Or, saving one image allocation::
  
          removed = relabel(remove_regions(labeled, regions), inplace=True)
  
      This is the same, but reuses the memory in the relabeling operation.
  
      Parameters
      ----------
      relabeled : ndarray of int
          A labeled array
      regions : sequence of int
          These regions will be removed
      inplace : boolean, optional
          Whether to perform removal inplace, erasing the values in
          ``labeled`` (default: False)
  
      Returns
      -------
      removed : ndarray
  
      See Also
      --------
      relabel : function
          After removing unecessary regions, it is often a good idea to relabel
          your label image.
      """
      labeled = _as_labeled(
          labeled, labeled, "remove_regions", inplace=inplace
      )
      regions = np.asarray(regions, dtype=np.intc)
      regions = np.unique(regions)
      _labeled.remove_regions(labeled, regions)
      return labeled
  
imports: from __future__ import division
  import numpy
  from .morph import get_structuring_elem
  from .None import _labeled
  from .internal import _get_output
  from ._filters import _checked_mode2int
  import mahotas
label_desc: Use image node_id 4 for calling a global function with example usage: remove_regions(labeled, regions, inplace) and returns: labeled