code: def up_capture(returns, factor_returns, **kwargs):
      """
      Compute the capture ratio for periods when the benchmark return is positive
  
      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_capture : float
  
      Note
      ----
      See http://www.investopedia.com/terms/u/up-market-capture-ratio.asp for
      more information.
      """
      return up(returns, factor_returns, function=capture, **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 45 for calling a global function with example usage: up_capture(returns, factor_returns) and returns: up