code: def clip_returns_to_benchmark(rets, benchmark_rets):
      """
      Drop entries from rets so that the start and end dates of rets match those
      of benchmark_rets.
  
      Parameters
      ----------
      rets : pd.Series
          Daily returns of the strategy, noncumulative.
           - See pf.tears.create_full_tear_sheet for more details
  
      benchmark_rets : pd.Series
          Daily returns of the benchmark, noncumulative.
  
      Returns
      -------
      clipped_rets : pd.Series
          Daily noncumulative returns with index clipped to match that of
          benchmark returns.
      """
  
      if (rets.index[0] < benchmark_rets.index[0]) or (
          rets.index[-1] > benchmark_rets.index[-1]
      ):
          clipped_rets = rets[benchmark_rets.index]
      else:
          clipped_rets = rets
  
      return clipped_rets
  
imports: from __future__ import division
  import warnings
  from itertools import cycle
  from matplotlib.pyplot import cm
  import numpy
  import pandas
  from IPython.display import display, HTML
  import empyrical.utils
  from .None import pos
  from .None import txn
label_desc: Use image node_id 12 for calling a global function with example usage: clip_returns_to_benchmark(rets, benchmark_rets) and returns: clipped_rets