code: def filter_proba(data, p, replace=None, above=True):
      """
  
      :param numpy data: Input data
      :param float p: Probability for filtering (or be replaced)
      :param float replace: Default value is None. If value is provided, input data will be replaced by this value
          if data match criteria.
      :param bool above: If True is passed, only value larger than p will be kept (or not replaced)
      :return: numpy Filtered result
      """
  
      if replace:
          new_data = data.copy()
          if above:
              idxes = np.argwhere(data > p).flatten()
              replace_idxes = np.argwhere(data <= p).flatten()
          else:
              idxes = np.argwhere(data < p).flatten()
              replace_idxes = np.argwhere(data >= p).flatten()
          new_data[replace_idxes] = replace
  
          return new_data, idxes
  
      if above:
          idxes = np.argwhere(data >= p).flatten()
      else:
          idxes = np.argwhere(data <= p).flatten()
  
      return data[idxes], idxes
  
imports: import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: filter_proba(data, p, replace, above) and returns: data,  idxes, new_data,  idxes