code: def _split_on_reappear(cls, df, p, id_offset):
          
  
          next_id = id_offset + 1
          added_ids = []
          nt = p.sum(0)
          start = np.argmax(p, 0)
          end = np.argmax(np.cumsum(p, 0), 0)
          diff = end - start + 1
          is_contiguous = np.equal(nt, diff)
          for id, contiguous in enumerate(is_contiguous):
              if not contiguous:
  
                  to_change = df[df.id == id]
                  index = to_change.index
                  diff = index[1:] - index[:-1]
                  where = np.where(np.greater(diff, 1))[0]
                  for w in where:
                      to_change.loc[w + 1:, 'id'] = next_id
                      added_ids.append(next_id)
                      next_id += 1
  
                  df[df.id == id] = to_change
  
          return added_ids
docs: Assign a new identity to an objects that appears after disappearing previously.
          Works on `df` in-place.
          :param df: data frame
          :param p: presence
          :param id_offset: offset added to new ids
          :return: