code: def split_unit(self, unit_id, indices):
          '''This function splits a root from the curation tree according to the given unit_id and indices. It creates two new unit_ids
          and roots that have the split root as a child. This function splits the spike train of the root by the given indices.
          Parameters
          ----------
          unit_id: int
              The unit id to be split
          indices: list
              The indices of the unit spike train at which the spike train will be split.
          '''
          root_ids = []
          for i in range(len(self._roots)):
              root_id = self._roots[i].unit_id
              root_ids.append(root_id)
          if(unit_id in root_ids):
              indices_1 = np.sort(np.asarray(list(set(indices))))
              root_index = root_ids.index(unit_id)
              new_child = self._roots[root_index]
              original_spike_train = self._roots[root_index].get_spike_train()
              try:
                  spike_train_1 = original_spike_train[indices_1]
              except IndexError:
                  print(str(indices) + " out of bounds for the spike train of " + str(unit_id))
              indices_2 = list(set(range(len(original_spike_train))) - set(indices_1))
              spike_train_2 = original_spike_train[indices_2]
              del original_spike_train
              new_root_1_id = max(self._all_ids)+1
              self._all_ids.append(new_root_1_id)
              new_root_1 = Unit(new_root_1_id)
              new_root_1.add_child(new_child)
              new_root_1.set_spike_train(spike_train_1)
              new_root_2_id = max(self._all_ids)+1
              self._all_ids.append(new_root_2_id)
              new_root_2 = Unit(new_root_2_id)
              new_root_2.add_child(new_child)
              new_root_2.set_spike_train(spike_train_2)
              self._roots.append(new_root_1)
              self._roots.append(new_root_2)
              for feature_name in self.get_unit_spike_feature_names(unit_id):
                  full_features = self.get_unit_spike_features(unit_id, feature_name)
                  self.set_unit_spike_features(new_root_1_id, feature_name, full_features[indices_1])
                  self.set_unit_spike_features(new_root_2_id, feature_name, full_features[indices_2])
              del self._unit_features[unit_id]
              del self._roots[root_index]
          else:
              raise ValueError(str(unit_id) + " non-valid unit id")