code: def test_sortino_ratio(self, net_worths):
      scheme = rewards.RiskAdjustedReturns(
          return_algorithm="sortino",
          risk_free_rate=0,
          target_returns=0,
          window_size=1,
      )
  
      returns = net_worths[-2:].pct_change().dropna()
  
      downside_returns = returns.copy()
      downside_returns[returns < 0] = returns**2
  
      expected_return = np.mean(returns)
      downside_std = np.sqrt(np.std(downside_returns))
  
      expected_ratio = (expected_return + 1e-9) / (downside_std + 1e-9)
      sortino_ratio = scheme._sortino_ratio(returns)
  
      assert sortino_ratio == expected_ratio
  
file_path: tensortrade/tests/tensortrade/unit/env/default/test_rewards.py
imports: import pytest
  import numpy
  import pandas
  from collections import OrderedDict
  import tensortrade.env.default.rewards
  from tensortrade.core import TradingContext
  from tensortrade.oms.wallets import Portfolio
  from tensortrade.oms.instruments import USD
label_desc: Use image node_id 2 for calling the TestRiskAdjustedReturns obj's underlying member method code with example usage: obj.test_sortino_ratio(net_worths) without return types