code: def has_data_for_dates(series_or_df, first_date, last_date):
      """
      Does `series_or_df` have data on or before first_date and on or after
      last_date?
      """
      dts = series_or_df.index
      if not isinstance(dts, pd.DatetimeIndex):
          raise TypeError(
              "Expected a DatetimeIndex, but got %s." % type(dts)
          )
      first, last = dts[[0, -1]].tz_localize(None)
      return (first <= first_date.tz_localize(None)) and (
          last >= last_date.tz_localize(None)
      )
  
imports: import os
  from collections import OrderedDict
  import logbook
  import pandas
  import pytz
  from pandas_datareader.data import DataReader
  from six import iteritems
  from six.moves.urllib_error import HTTPError
  from catalyst.constants import LOG_LEVEL
  from catalyst.utils.calendars import get_calendar
  from .None import treasuries, treasuries_can
  from .benchmarks import get_benchmark_returns
  from ..utils.deprecate import deprecated
  from ..utils.paths import cache_root, data_root
label_desc: Use image node_id 5 for calling a global function with example usage: has_data_for_dates(series_or_df, first_date, last_date) and returns: unknown