code: def tail_ratio(returns):
      """Determines the ratio between the right (95%) and left tail (5%).
  
      For example, a ratio of 0.25 means that losses are four times
      as bad as profits.
  
      Parameters
      ----------
      returns : pd.Series or np.ndarray
          Daily returns of the strategy, noncumulative.
           - See full explanation in :func:`~empyrical.stats.cum_returns`.
  
      Returns
      -------
      float
          tail ratio
  
      """
  
      if len(returns) < 1:
          return np.nan
  
      returns = np.asanyarray(returns)
      # Be tolerant of nan's
      returns = returns[~np.isnan(returns)]
      if len(returns) < 1:
          return np.nan
  
      return np.abs(np.percentile(returns, 95)) / np.abs(
          np.percentile(returns, 5)
      )
  
imports: from __future__ import division
  from functools import wraps
  import pandas
  import numpy
  from scipy import stats
  from six import iteritems
  from empyrical.utils import nanmean, nanstd, nanmin
label_desc: Use image node_id 25 for calling a global function with example usage: tail_ratio(returns) and returns: unknown, np, np