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
      -------
      tail_ratio : float
      """
  
      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
  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 30 for calling a global function with example usage: tail_ratio(returns) and returns: unknown, np, np