code: def download_with_progress(url, chunk_size, **progress_kwargs):
      """
      Download streaming data from a URL, printing progress information to the
      terminal.
  
      Parameters
      ----------
      url : str
          A URL that can be understood by ``requests.get``.
      chunk_size : int
          Number of bytes to read at a time from requests.
      **progress_kwargs
          Forwarded to click.progressbar.
  
      Returns
      -------
      data : BytesIO
          A BytesIO containing the downloaded data.
      """
      resp = requests.get(url, stream=True)
      resp.raise_for_status()
  
      total_size = int(resp.headers["content-length"])
      data = BytesIO()
  
      progress_kwargs["length"] = total_size
      with maybe_show_progress(None, True, **progress_kwargs) as pbar:
          for chunk in resp.iter_content(chunk_size=chunk_size):
              data.write(chunk)
              pbar.update(len(chunk))
  
      data.seek(0)
      return data
  
imports: from collections import namedtuple
  import errno
  from io import BytesIO
  import os
  import requests
  import shutil
  import warnings
  from contextlib2 import ExitStack
  import click
  import pandas
  from toolz import curry, complement, take
  from ..us_equity_pricing import BcolzDailyBarReader, BcolzDailyBarWriter, SQLiteAdjustmentReader, SQLiteAdjustmentWriter
  from ..minute_bars import BcolzMinuteBarReader, BcolzMinuteBarWriter
  from catalyst.assets import AssetDBWriter, AssetFinder, ASSET_DB_VERSION
  from catalyst.assets.asset_db_migrations import downgrade
  from catalyst.utils.cache import dataframe_cache, working_dir, working_file
  from catalyst.utils.compat import mappingproxy
  from catalyst.utils.input_validation import ensure_timestamp, optionally
  import catalyst.utils.paths
  from catalyst.utils.preprocess import preprocess
  from catalyst.utils.calendars import get_calendar
  from catalyst.utils.cli import maybe_show_progress
label_desc: Use image node_id 14 for calling a global function with example usage: download_with_progress(url, chunk_size) and returns: data