code: def downside_risk(returns, required_return=0, period=DAILY):
      """
      Determines the downside deviation below a threshold
  
      Parameters
      ----------
      returns : pd.Series or pd.DataFrame
          Daily returns of the strategy, noncumulative.
          - See full explanation in :func:`~pyfolio.timeseries.cum_returns`.
      required_return: float / series
          minimum acceptable return
      period : str, optional
          Defines the periodicity of the 'returns' data for purposes of
          annualizing. Can be 'monthly', 'weekly', or 'daily'.
          - Defaults to 'daily'.
  
      Returns
      -------
      depends on input type
      series ==> float
      DataFrame ==> np.array
  
          Annualized downside deviation
      """
  
      return ep.downside_risk(
          returns, required_return=required_return, period=period
      )
  
imports: from __future__ import division
  from collections import OrderedDict
  from functools import partial
  import empyrical
  import numpy
  import pandas
  import scipy
  import scipy.stats
  from sklearn import linear_model
  from .deprecate import deprecated
  from .interesting_periods import PERIODS
  from .txn import get_turnover
  from .utils import APPROX_BDAYS_PER_MONTH, APPROX_BDAYS_PER_YEAR
  from .utils import DAILY
label_desc: Use image node_id 8 for calling a global function with example usage: downside_risk(returns, required_return, period) and returns: ep