class_docstr: A class for wälder, that are phylogenetic forests, elements of the Wald Space.
  
  Parameters
  ----------
  topology : Topology
      The structure of the forest.
  weights : array-like
      The edge weights, array of floats between 0 and 1, with m entries, where m is
      the total number of splits/edges in the structure ``top``.
class_docstr_tok: ["A","class","for","w\u00e4lder",",","that","are","phylogenetic","forests",",","elements","of","the","Wald","Space",".","Parameters","--","--","--","--","--","topology",":","Topology","The","structure","of","the","forest",".","weights",":","array-like","The","edge","weights",",","array","of","floats","between","0","and","1",",","with","m","entries",",","where","m","is","the","total","number","of","splits\/edges","in","the","structure","``","top","``","."]
docstr: Delete splits randomly from a set of splits.
  
  We require the splits to satisfy the check for if all pair-wise labels are
  separated. In this way, before deleting a split, this condition is checked
  to make sure it is not violated.
  
  Parameters
  ----------
  splits : list[Split]
      A list of splits of the set of labels.
  labels : list[int]
      A list of integers, the set of labels that we generate splits for.
  p_keep : float
      A float between 0 and 1 determining the probability with which a split
      is kept and not deleted.
  check : bool
      If True, checks if splits still separate all labels. In this case, the split
      will not be deleted. If False, any split can be randomly deleted.
  
  Returns
  -------
  left_over_splits : list[Split]
      The list of splits that are not deleted.
code: def _delete_splits(splits, labels, p_keep, check=True):
      """Delete splits randomly from a set of splits.
  
      We require the splits to satisfy the check for if all pair-wise labels are
      separated. In this way, before deleting a split, this condition is checked
      to make sure it is not violated.
  
      Parameters
      ----------
      splits : list[Split]
          A list of splits of the set of labels.
      labels : list[int]
          A list of integers, the set of labels that we generate splits for.
      p_keep : float
          A float between 0 and 1 determining the probability with which a split
          is kept and not deleted.
      check : bool
          If True, checks if splits still separate all labels. In this case, the split
          will not be deleted. If False, any split can be randomly deleted.
  
      Returns
      -------
      left_over_splits : list[Split]
          The list of splits that are not deleted.
      """
      if p_keep == 1:
          return splits
      for i in reversed(range(len(splits))):
          if gs.random.rand(1) > p_keep:
              splits_cp = splits.copy()
              splits_cp.pop(i)
              if not check:
                  splits = splits_cp
              elif Wald._check_if_separated(
                  splits=splits_cp, labels=labels
              ):
                  splits = splits_cp
      return splits
  
imports: import functools
  import itertools
  import geomstats.backend
  import geomstats.geometry.spd_matrices
  from geomstats.geometry.stratified.point_set import Point, PointSet, _vectorize_point
label_desc: Use image node_id 9 for calling the Wald obj's underlying member method code with example usage: obj._delete_splits(splits, labels, p_keep, check) and returns: splits, splits