code: def perf_stats_bootstrap(
      returns, factor_returns=None, return_stats=True, **kwargs
  ):
      """Calculates various bootstrapped performance metrics of a strategy.
  
      Parameters
      ----------
      returns : pd.Series
          Daily returns of the strategy, noncumulative.
           - See full explanation in tears.create_full_tear_sheet.
      factor_returns : pd.Series, optional
          Daily noncumulative returns of the benchmark factor to which betas are
          computed. Usually a benchmark such as market returns.
           - This is in the same style as returns.
           - If None, do not compute alpha, beta, and information ratio.
      return_stats : boolean (optional)
          If True, returns a DataFrame of mean, median, 5 and 95 percentiles
          for each perf metric.
          If False, returns a DataFrame with the bootstrap samples for
          each perf metric.
  
      Returns
      -------
      pd.DataFrame
          if return_stats is True:
          - Distributional statistics of bootstrapped sampling
          distribution of performance metrics.
          if return_stats is False:
          - Bootstrap samples for each performance metric.
      """
  
      bootstrap_values = OrderedDict()
  
      for stat_func in SIMPLE_STAT_FUNCS:
          stat_name = STAT_FUNC_NAMES[stat_func.__name__]
          bootstrap_values[stat_name] = calc_bootstrap(
              stat_func, returns
          )
  
      if factor_returns is not None:
          for stat_func in FACTOR_STAT_FUNCS:
              stat_name = STAT_FUNC_NAMES[stat_func.__name__]
              bootstrap_values[stat_name] = calc_bootstrap(
                  stat_func, returns, factor_returns=factor_returns
              )
  
      bootstrap_values = pd.DataFrame(bootstrap_values)
  
      if return_stats:
          stats = bootstrap_values.apply(calc_distribution_stats)
          return stats.T[["mean", "median", "5%", "95%"]]
      else:
          return bootstrap_values
  
imports: from __future__ import division
  from collections import OrderedDict
  from functools import partial
  import empyrical
  import numpy
  import pandas
  import scipy
  import scipy.stats
  from sklearn import linear_model
  from .deprecate import deprecated
  from .interesting_periods import PERIODS
  from .txn import get_turnover
  from .utils import APPROX_BDAYS_PER_MONTH, APPROX_BDAYS_PER_YEAR
  from .utils import DAILY
label_desc: Use image node_id 24 for calling a global function with example usage: perf_stats_bootstrap(returns, factor_returns, return_stats) and returns: stats, bootstrap_values