code: def sharpe_ratio(
      returns, risk_free=0, period=DAILY, annualization=None
  ):
      """
      Determines the Sharpe ratio of a strategy.
  
      Parameters
      ----------
      returns : pd.Series or np.ndarray
          Daily returns of the strategy, noncumulative.
          - See full explanation in :func:`~empyrical.stats.cum_returns`.
      risk_free : int, float
          Constant risk-free return throughout the period.
      period : str, optional
          Defines the periodicity of the 'returns' data for purposes of
          annualizing. Value ignored if `annualization` parameter is specified.
          Defaults are:
              'monthly':12
              'weekly': 52
              'daily': 252
      annualization : int, optional
          Used to suppress default values available in `period` to convert
          returns into annual returns. Value should be the annual frequency of
          `returns`.
  
      Returns
      -------
      float
          Sharpe ratio.
  
          np.nan
              If insufficient length of returns or if if adjusted returns are 0.
  
      Note
      -----
      See https://en.wikipedia.org/wiki/Sharpe_ratio for more details.
  
      """
  
      if len(returns) < 2:
          return np.nan
  
      ann_factor = annualization_factor(period, annualization)
  
      returns_risk_adj = np.asanyarray(
          _adjust_returns(returns, risk_free)
      )
      returns_risk_adj = returns_risk_adj[~np.isnan(returns_risk_adj)]
  
      if np.std(returns_risk_adj, ddof=1) == 0:
          return np.nan
  
      return (
          np.mean(returns_risk_adj)
          / np.std(returns_risk_adj, ddof=1)
          * np.sqrt(ann_factor)
      )
  
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 13 for calling a global function with example usage: sharpe_ratio(returns, risk_free, period, annualization) and returns: unknown, np, np