code: def sortino_ratio(
      close: Series, benchmark_rate: float = 0.0, log: bool = False
  ) -> float:
      """Sortino Ratio of a series.
  
      Args:
          close (pd.Series): Series of 'close's
          benchmark_rate (float): Benchmark Rate to use. Default: 0.0
          log (bool): If True, calculates log_return. Otherwise it returns
              percent_return. Default: False
  
      >>> result = ta.sortino_ratio(close, benchmark_rate=0.0, log=False)
      """
      close = verify_series(close)
      returns = (
          percent_return(close=close)
          if not log
          else log_return(close=close)
      )
  
      result = cagr(close) - benchmark_rate
      result /= downside_deviation(returns)
      return result
  
imports: from typing import Tuple
  from numpy import log
  from numpy import nan
  from numpy import sqrt
  from pandas import Series, Timedelta
  from ._core import verify_series
  from ._time import total_time
  from ._math import linear_regression, log_geometric_mean
  from pandas_ta import RATE
  from pandas_ta.performance import drawdown, log_return, percent_return
label_desc: Use image node_id 10 for calling a global function with example usage: sortino_ratio(close, benchmark_rate, log) and returns: result