code: def _load_raw_yahoo_data(
      indexes=None, stocks=None, start=None, end=None
  ):
      """Load closing prices from yahoo finance.
  
      :Optional:
          indexes : dict (Default: {'SPX': '^SPY'})
              Financial indexes to load.
          stocks : list (Default: ['AAPL', 'GE', 'IBM', 'MSFT',
                                   'XOM', 'AA', 'JNJ', 'PEP', 'KO'])
              Stock closing prices to load.
          start : datetime (Default: datetime(1993, 1, 1, 0, 0, 0, 0, pytz.utc))
              Retrieve prices from start date on.
          end : datetime (Default: datetime(2002, 1, 1, 0, 0, 0, 0, pytz.utc))
              Retrieve prices until end date.
  
      :Note:
          This is based on code presented in a talk by Wes McKinney:
          http://wesmckinney.com/files/20111017/notebook_output.pdf
      """
      assert (
          indexes is not None or stocks is not None
      ), """
  must specify stocks or indexes"""
  
      if start is None:
          start = pd.datetime(1990, 1, 1, 0, 0, 0, 0, pytz.utc)
  
      if start is not None and end is not None:
          assert start < end, "start date is later than end date."
  
      data = OrderedDict()
  
      if stocks is not None:
          for stock in stocks:
              logger.info("Loading stock: {}".format(stock))
              stock_pathsafe = stock.replace(os.path.sep, "--")
              cache_filename = "{stock}-{start}-{end}.csv".format(
                  stock=stock_pathsafe, start=start, end=end
              ).replace(":", "-")
              cache_filepath = get_cache_filepath(cache_filename)
              if os.path.exists(cache_filepath):
                  stkd = pd.DataFrame.from_csv(cache_filepath)
              else:
                  stkd = DataReader(
                      stock, "yahoo", start, end
                  ).sort_index()
                  stkd.to_csv(cache_filepath)
              data[stock] = stkd
  
      if indexes is not None:
          for name, ticker in iteritems(indexes):
              logger.info("Loading index: {} ({})".format(name, ticker))
              stkd = DataReader(
                  ticker, "yahoo", start, end
              ).sort_index()
              data[name] = stkd
  
      return data
  
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 12 for calling a global function with example usage: _load_raw_yahoo_data(indexes, stocks, start, end) and returns: data