code: def volatility(
      close: Series,
      tf: str = "years",
      returns: bool = False,
      log: bool = False,
      **kwargs,
  ) -> float:
      """Volatility of a series. Default: 'years'
  
      Args:
          close (pd.Series): Series of 'close's
          tf (str): Time Frame options: 'days', 'weeks', 'months', and 'years'.
              Default: 'years'
          returns (bool): If True, then it replace the close Series with the user
              defined Series; typically user generated returns or percent returns
              or log returns. Default: False
          log (bool): If True, calculates log_return. Otherwise it calculates
              percent_return. Default: False
  
      >>> result = ta.volatility(close, tf="years", returns=False, log=False, **kwargs)
      """
      close = verify_series(close)
  
      if not returns:
          returns = (
              percent_return(close=close)
              if not log
              else log_return(close=close)
          )
      else:
          returns = close
  
      returns = log_geometric_mean(returns).std()
      # factor = returns.shape[0] / total_time(returns, tf)
      # if kwargs.pop("nearest_day", False) and tf.lower() == "years":
      # factor = int(factor + 1)
      # return npSqrt(factor) * returns.std()
      return returns
  
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 11 for calling a global function with example usage: volatility(close, tf, returns, log) and returns: returns