code: def downside_risk(
      data: pd.DataFrame,
      weights: ARRAY_OR_SERIES[FLOAT],
      risk_free_rate: FLOAT = 0.005,
  ) -> FLOAT:
      """Computes the downside risk (target downside deviation of returns).
  
      :param data: A dataframe of daily stock prices
  
      :param weights: Downside Risk of a portfolio
      :type weights: :py:data:`~.finquant.data_types.ARRAY_OR_SERIES`
  
      :param risk_free_rate: Risk free rate
      :type risk_free_rate: :py:data:`~.finquant.data_types.FLOAT`, default: 0.005
  
      :rtype: :py:data:`~.finquant.data_types.FLOAT`
      :return: Target downside deviation
          ``np.sqrt(np.mean(np.minimum(0, wtd_daily_mean - risk_free_rate) ** 2))``
      """
      # Type validations:
      type_validation(
          data=data, weights=weights, risk_free_rate=risk_free_rate
      )
      wtd_daily_mean = weighted_mean_daily_returns(data, weights)
      return float(
          np.sqrt(
              np.mean(
                  np.minimum(0, wtd_daily_mean - risk_free_rate) ** 2
              )
          )
      )
  
file_path: FinQuant/finquant/quants.py
imports: from typing import Optional, Tuple
  import numpy
  import pandas
  from scipy.stats import norm
  from finquant.data_types import ARRAY_OR_DATAFRAME, ARRAY_OR_SERIES, FLOAT, INT, NUMERIC
  from finquant.returns import weighted_mean_daily_returns
  from finquant.type_utilities import type_validation
label_desc: Use image node_id 6 for calling a global function with example usage: downside_risk(data, weights, risk_free_rate) and returns: float