docs: def reassign_labels(self, labels, new_label, relabel=False):
          """
          Reassign one or more label numbers.
  
          Multiple input ``labels`` will all be reassigned to the same
          ``new_label`` number.  If ``new_label`` is already present in
          the segmentation image, then it will be combined with the input
          ``labels``.
  
          Parameters
          ----------
          labels : int, array-like (1D, int)
              The label numbers(s) to reassign.
  
          new_label : int
              The reassigned label number.
  
          relabel : bool, optional
              If `True`, then the segmentation image will be relabeled
              such that the labels are in consecutive order starting from
              1.
  
          Examples
          --------
          >>> from photutils import SegmentationImage
          >>> segm = SegmentationImage([[1, 1, 0, 0, 4, 4],
          ...                           [0, 0, 0, 0, 0, 4],
          ...                           [0, 0, 3, 3, 0, 0],
          ...                           [7, 0, 0, 0, 0, 5],
          ...                           [7, 7, 0, 5, 5, 5],
          ...                           [7, 7, 0, 0, 5, 5]])
          >>> segm.reassign_labels(labels=[1, 7], new_label=2)
          >>> segm.data
          array([[2, 2, 0, 0, 4, 4],
                 [0, 0, 0, 0, 0, 4],
                 [0, 0, 3, 3, 0, 0],
                 [2, 0, 0, 0, 0, 5],
                 [2, 2, 0, 5, 5, 5],
                 [2, 2, 0, 0, 5, 5]])
  
          >>> segm = SegmentationImage([[1, 1, 0, 0, 4, 4],
          ...                           [0, 0, 0, 0, 0, 4],
          ...                           [0, 0, 3, 3, 0, 0],
          ...                           [7, 0, 0, 0, 0, 5],
          ...                           [7, 7, 0, 5, 5, 5],
          ...                           [7, 7, 0, 0, 5, 5]])
          >>> segm.reassign_labels(labels=[1, 7], new_label=4)
          >>> segm.data
          array([[4, 4, 0, 0, 4, 4],
                 [0, 0, 0, 0, 0, 4],
                 [0, 0, 3, 3, 0, 0],
                 [4, 0, 0, 0, 0, 5],
                 [4, 4, 0, 5, 5, 5],
                 [4, 4, 0, 0, 5, 5]])
  
          >>> segm = SegmentationImage([[1, 1, 0, 0, 4, 4],
          ...                           [0, 0, 0, 0, 0, 4],
          ...                           [0, 0, 3, 3, 0, 0],
          ...                           [7, 0, 0, 0, 0, 5],
          ...                           [7, 7, 0, 5, 5, 5],
          ...                           [7, 7, 0, 0, 5, 5]])
          >>> segm.reassign_labels(labels=[1, 7], new_label=2, relabel=True)
          >>> segm.data
          array([[1, 1, 0, 0, 3, 3],
                 [0, 0, 0, 0, 0, 3],
                 [0, 0, 2, 2, 0, 0],
                 [1, 0, 0, 0, 0, 4],
                 [1, 1, 0, 4, 4, 4],
                 [1, 1, 0, 0, 4, 4]])
          """
  
          self.check_labels(labels)
  
          labels = np.atleast_1d(labels)
          if len(labels) == 0:
              return
  
          idx = np.zeros(self.max_label + 1, dtype=int)
          idx[self.labels] = self.labels
          idx[labels] = new_label
  
          # calling the data setter resets all cached properties
          self.data = idx[self.data]
  
          if relabel:
              self.relabel_consecutive()