code: def sortino_ratio(
      returns,
      required_return=0,
      period=DAILY,
      annualization=None,
      _downside_risk=None,
  ):
      """
      Determines the Sortino ratio of a strategy.
  
      Parameters
      ----------
      returns : pd.Series or np.ndarray or pd.DataFrame
          Daily returns of the strategy, noncumulative.
          - See full explanation in :func:`~empyrical.stats.cum_returns`.
      required_return: float / series
          minimum acceptable return
      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`.
      _downside_risk : float, optional
          The downside risk of the given inputs, if known. Will be calculated if
          not provided.
  
      Returns
      -------
      float, pd.Series
  
          depends on input type
          series ==> float
          DataFrame ==> pd.Series
  
          Annualized Sortino ratio.
  
      """
  
      if len(returns) < 2:
          return np.nan
  
      ann_factor = annualization_factor(period, annualization)
  
      adj_returns = _adjust_returns(returns, required_return)
      mu = nanmean(adj_returns, axis=0)
      dsr = (
          _downside_risk
          if _downside_risk is not None
          else downside_risk(returns, required_return)
      )
      sortino = mu / dsr
      return sortino * 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 14 for calling a global function with example usage: sortino_ratio(returns, required_return, period, annualization, _downside_risk) and returns: unknown, np