code: def _shift_dates(dates, start_date, end_date, shift):
      try:
          start = dates.get_loc(start_date)
      except KeyError:
          if start_date < dates[0]:
              raise NoFurtherDataError(
                  msg=(
                      "Pipeline Query requested data starting on {query_start}, "
                      "but first known date is {calendar_start}"
                  ).format(
                      query_start=str(start_date),
                      calendar_start=str(dates[0]),
                  )
              )
          else:
              raise ValueError(
                  "Query start %s not in calendar" % start_date
              )
  
      # Make sure that shifting doesn't push us out of the calendar.
      if start < shift:
          raise NoFurtherDataError(
              msg=(
                  "Pipeline Query requested data from {shift}"
                  " days before {query_start}, but first known date is only "
                  "{start} days earlier."
              ).format(
                  shift=shift, query_start=start_date, start=start
              ),
          )
  
      try:
          end = dates.get_loc(end_date)
      except KeyError:
          if end_date > dates[-1]:
              raise NoFurtherDataError(
                  msg=(
                      "Pipeline Query requesting data up to {query_end}, "
                      "but last known date is {calendar_end}"
                  ).format(
                      query_end=end_date,
                      calendar_end=dates[-1],
                  )
              )
          else:
              raise ValueError(
                  "Query end %s not in calendar" % end_date
              )
      return dates[start - shift], dates[end - shift]
  
file_path: catalyst/catalyst/exchange/exchange_pricing_loader.py
imports: from catalyst.constants import LOG_LEVEL
  from catalyst.data.us_equity_pricing import BcolzDailyBarReader
  from catalyst.errors import NoFurtherDataError
  from catalyst.exchange.utils.factory import get_exchange
  from catalyst.lib.adjusted_array import AdjustedArray
  from catalyst.pipeline.data import DataSet, Column
  from catalyst.pipeline.loaders.base import PipelineLoader
  from catalyst.utils.calendars import get_calendar
  from catalyst.utils.numpy_utils import float64_dtype
  from logbook import Logger
  from numpy import iinfo, uint32
label_desc: Use image node_id 1 for calling a global function with example usage: _shift_dates(dates, start_date, end_date, shift) and returns: dates,  dates