code: def gpd_risk_estimates(returns, var_p=0.01):
      """Estimate VaR and ES using the Generalized Pareto Distribution (GPD)
  
          Parameters
          ----------
          returns : pd.Series or np.ndarray
              Daily returns of the strategy, noncumulative.
              - See full explanation in :func:`~empyrical.stats.cum_returns`.
          var_p : float
              The percentile to use for estimating the VaR and ES
  
          Returns
          -------
          [threshold, scale_param, shape_param, var_estimate, es_estimate]
              : list[float]
              threshold - the threshold use to cut off exception tail losses
              scale_param - a parameter (often denoted by sigma, capturing the
                  scale, related to variance)
              shape_param - a parameter (often denoted by xi, capturing the shape or
                  type of the distribution)
              var_estimate - an estimate for the VaR for the given percentile
              es_estimate - an estimate for the ES for the given percentile
  
          Note
          ----
          seealso::
          `An Application of Extreme Value Theory for
      Measuring Risk <https://link.springer.com/article/10.1007/s10614-006-9025-7>`
              A paper describing how to use the Generalized Pareto
              Distribution to estimate VaR and ES.
      """
      if len(returns) < 3:
          result = np.zeros(5)
          if isinstance(returns, pd.Series):
              result = pd.Series(result)
          return result
      return gpd_risk_estimates_aligned(
          *_aligned_series(returns, var_p)
      )
  
imports: from __future__ import division
  import math
  import pandas
  import numpy
  from math import pow
  from scipy import stats, optimize
  from six import iteritems
  from sys import float_info
  from .utils import nanmean, nanstd, nanmin, up, down, roll, rolling_window
  from .periods import ANNUALIZATION_FACTORS, APPROX_BDAYS_PER_YEAR
  from .periods import DAILY, WEEKLY, MONTHLY, QUARTERLY, YEARLY
label_desc: Use image node_id 34 for calling a global function with example usage: gpd_risk_estimates(returns, var_p) and returns: gpd_risk_estimates_aligned, result