code: def up_down_capture(returns, factor_returns, **kwargs):
      """
      Computes the ratio of up_capture to down_capture.
  
      Parameters
      ----------
      returns : pd.Series or np.ndarray
          Returns of the strategy, noncumulative.
          - See full explanation in :func:`~empyrical.stats.cum_returns`.
      factor_returns : pd.Series or np.ndarray
          Noncumulative returns of the factor to which beta is
          computed. Usually a benchmark such as the market.
          - This is in the same style as returns.
      period : str, optional
          Defines the periodicity of the 'returns' data for purposes of
          annualizing. Value ignored if `annualization` parameter is specified.
          Defaults are::
  
              'monthly':12
              'weekly': 52
              'daily': 252
  
      Returns
      -------
      up_down_capture : float
          the updown capture ratio
      """
      return up_capture(
          returns, factor_returns, **kwargs
      ) / down_capture(returns, factor_returns, **kwargs)
  
imports: from __future__ import division
  import math
  import pandas
  import numpy
  from math import pow
  from scipy import stats, optimize
  from six import iteritems
  from sys import float_info
  from .utils import nanmean, nanstd, nanmin, up, down, roll, rolling_window
  from .periods import ANNUALIZATION_FACTORS, APPROX_BDAYS_PER_YEAR
  from .periods import DAILY, WEEKLY, MONTHLY, QUARTERLY, YEARLY
label_desc: Use image node_id 47 for calling a global function with example usage: up_down_capture(returns, factor_returns) and returns: unknown