code: def create_summary_tear_sheet(
      factor_data, long_short=True, group_neutral=False
  ):
      """
      Creates a small summary tear sheet with returns, information, and turnover
      analysis.
  
      Parameters
      ----------
      factor_data : pd.DataFrame - MultiIndex
          A MultiIndex DataFrame indexed by date (level 0) and asset (level 1),
          containing the values for a single alpha factor, forward returns for
          each period, the factor quantile/bin that factor value belongs to, and
          (optionally) the group the asset belongs to.
          - See full explanation in utils.get_clean_factor_and_forward_returns
      long_short : bool
          Should this computation happen on a long short portfolio? if so, then
          mean quantile returns will be demeaned across the factor universe.
      group_neutral : bool
          Should this computation happen on a group neutral portfolio? if so,
          returns demeaning will occur on the group level.
      """
  
      # Returns Analysis
      mean_quant_ret, std_quantile = perf.mean_return_by_quantile(
          factor_data,
          by_group=False,
          demeaned=long_short,
          group_adjust=group_neutral,
      )
  
      mean_quant_rateret = mean_quant_ret.apply(
          utils.rate_of_return,
          axis=0,
          base_period=mean_quant_ret.columns[0],
      )
  
      (
          mean_quant_ret_bydate,
          std_quant_daily,
      ) = perf.mean_return_by_quantile(
          factor_data,
          by_date=True,
          by_group=False,
          demeaned=long_short,
          group_adjust=group_neutral,
      )
  
      mean_quant_rateret_bydate = mean_quant_ret_bydate.apply(
          utils.rate_of_return,
          axis=0,
          base_period=mean_quant_ret_bydate.columns[0],
      )
  
      compstd_quant_daily = std_quant_daily.apply(
          utils.std_conversion,
          axis=0,
          base_period=std_quant_daily.columns[0],
      )
  
      alpha_beta = perf.factor_alpha_beta(
          factor_data, demeaned=long_short, group_adjust=group_neutral
      )
  
      (
          mean_ret_spread_quant,
          std_spread_quant,
      ) = perf.compute_mean_returns_spread(
          mean_quant_rateret_bydate,
          factor_data["factor_quantile"].max(),
          factor_data["factor_quantile"].min(),
          std_err=compstd_quant_daily,
      )
  
      periods = utils.get_forward_returns_columns(factor_data.columns)
      periods = list(map(lambda p: pd.Timedelta(p).days, periods))
  
      fr_cols = len(periods)
      vertical_sections = 2 + fr_cols * 3
      gf = GridFigure(rows=vertical_sections, cols=1)
  
      plotting.plot_quantile_statistics_table(factor_data)
  
      plotting.plot_returns_table(
          alpha_beta, mean_quant_rateret, mean_ret_spread_quant
      )
  
      plotting.plot_quantile_returns_bar(
          mean_quant_rateret,
          by_group=False,
          ylim_percentiles=None,
          ax=gf.next_row(),
      )
  
      # Information Analysis
      ic = perf.factor_information_coefficient(factor_data)
      plotting.plot_information_table(ic)
  
      # Turnover Analysis
      quantile_factor = factor_data["factor_quantile"]
  
      quantile_turnover = {
          p: pd.concat(
              [
                  perf.quantile_turnover(quantile_factor, q, p)
                  for q in range(1, int(quantile_factor.max()) + 1)
              ],
              axis=1,
          )
          for p in periods
      }
  
      autocorrelation = pd.concat(
          [
              perf.factor_rank_autocorrelation(factor_data, period)
              for period in periods
          ],
          axis=1,
      )
  
      plotting.plot_turnover_table(autocorrelation, quantile_turnover)
  
      plt.show()
      gf.close()
  
file_path: alphalens/alphalens/tears.py
imports: import matplotlib.gridspec
  import matplotlib.pyplot
  import pandas
  import warnings
  from .None import plotting
  from .None import performance
  from .None import utils
label_desc: Use image node_id 1 for calling a global function with example usage: create_summary_tear_sheet(factor_data, long_short, group_neutral) without return types