code: def test_downside_risk():
      data1 = pd.DataFrame(
          {"1": [1.0, 2.0, 4.0, 8.0], "2": [1.0, 2.0, 3.0, 4.0]}
      )
      weights = np.array([0.25, 0.75])
      rf_rate = 0.005
      dr1 = downside_risk(data1, weights, rf_rate)
      assert dr1 == 0
  
      data2 = pd.DataFrame({"1": [7.0, 6.0, 5.0, 4.0, 3.0]})
      weights = np.array([1.0])
      rf_rate = 0.0
      dr2 = downside_risk(data2, weights, rf_rate)
      assert abs(dr2 - 0.19409143531019335) <= 1e-15
  
file_path: FinQuant/tests/test_quants.py
imports: import pdb
  import numpy
  import pandas
  import pytest
  from finquant.quants import annualised_portfolio_quantities, downside_risk, sharpe_ratio, sortino_ratio, treynor_ratio, value_at_risk, weighted_mean, weighted_std
label_desc: Use image node_id 9 for calling a global function with example usage: test_downside_risk() without return types