code: def filter_top_k(data, k, replace=None, ascending=False):
      """
  
      :param numpy/tensor data: Input data
      :param float k: Number of top element will be reserved (or not 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 ascending: Return ascending order or descending order. Sorting will be executed if replace is None.
      :return: numpy/tensor Filtered result
      """
      if isinstance(data, np.ndarray):
          return filter_top_k_numpy(data, k, replace, ascending)
      if isinstance(data, torch.Tensor):
          return filter_top_k_pytorch(data, k, replace, ascending)
      raise ValueError(
          "Only support numpy or pytorch's tensor while {} is provided".format(
              type(data)
          )
      )
  
imports: import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: filter_top_k(data, k, replace, ascending) and returns: filter_top_k_numpy, filter_top_k_pytorch