code: def download_files_for_symbol(symbol, fromYear, toYear):
      if not os.path.exists(storage):
          logger.info("Creating %s directory" % (storage))
          os.mkdir(storage)
  
      status = ""
      for year in range(fromYear, toYear + 1):
          fileName = get_csv_filename(symbol, year)
          if not os.path.exists(fileName):
              logger.info(
                  "Downloading %s %d to %s" % (symbol, year, fileName)
              )
              try:
                  yahoofinance.download_daily_bars(
                      symbol, year, fileName
                  )
                  status += "1"
              except Exception as e:
                  logger.error(str(e))
                  status += "0"
          else:
              status += "1"
  
      if status.find("1") == -1:
          logger.fatal("No data found for %s" % (symbol))
      elif status.lstrip("0").find("0") != -1:
          logger.fatal("Some bars are missing for %s" % (symbol))
  
imports: import os
  import sys
  import pyalgotrade.logger
  from pyalgotrade.tools import yahoofinance
  import symbolsxml
label_desc: Use image node_id 2 for calling a global function with example usage: download_files_for_symbol(symbol, fromYear, toYear) without return types