code: def get_benchmark_returns(symbol, first_date, last_date):
      """
      Get a Series of benchmark returns from Google associated with `symbol`.
      Default is `SPY`.
  
      Parameters
      ----------
      symbol : str
          Benchmark symbol for which we're getting the returns.
      first_date : pd.Timestamp
          First date for which we want to get data.
      last_date : pd.Timestamp
          Last date for which we want to get data.
  
      The furthest date that Google goes back to is 1993-02-01. It has missing
      data for 2008-12-15, 2009-08-11, and 2012-02-02, so we add data for the
      dates for which Google is missing data.
  
      We're also limited to 4000 days worth of data per request. If we make a
      request for data that extends past 4000 trading days, we'll still only
      receive 4000 days of data.
  
      first_date is **not** included because we need the close from day N - 1 to
      compute the returns for day N.
      """
      if symbol == "^GSPC":
          symbol = "spy"
  
      data = pd_reader.DataReader(
          symbol, "google", first_date, last_date
      )
  
      data = data["Close"]
  
      data[pd.Timestamp("2008-12-15")] = np.nan
      data[pd.Timestamp("2009-08-11")] = np.nan
      data[pd.Timestamp("2012-02-02")] = np.nan
  
      data = data.fillna(method="ffill")
  
      return data.sort_index().tz_localize("UTC").pct_change(1).iloc[1:]
  
imports: import numpy
  import pandas
  import pandas_datareader.data
label_desc: Use image node_id 1 for calling a global function with example usage: get_benchmark_returns(symbol, first_date, last_date) and returns: data