code: def pi(input, prob, dim=0):
      """
      Computes percentile interval which assigns equal probability mass
      to each tail of the interval.
  
      :param torch.Tensor input: the input tensor.
      :param float prob: the probability mass of samples within the interval.
      :param int dim: dimension to calculate percentile interval from ``input``.
      :returns torch.Tensor: quantiles of ``input`` at ``probs``.
      """
      return quantile(input, [(1 - prob) / 2, (1 + prob) / 2], dim)
  
imports: import math
  import numbers
  import torch
  from torch.fft import irfft, rfft
  from .tensor_utils import next_fast_len
label_desc: Use image node_id 10 for calling a global function with example usage: pi(input, prob, dim) and returns: quantile