code: def output_df(df, assets, name=None):
      """
      Outputs a price DataFrame to a temp folder.
  
      Parameters
      ----------
      df: pd.DataFrame
      assets
      name
  
      Returns
      -------
  
      """
      if isinstance(assets, TradingPair):
          exchange_folder = assets.exchange
          asset_folder = assets.symbol
      else:
          exchange_folder = ",".join(
              [asset.exchange for asset in assets]
          )
          asset_folder = ",".join([asset.symbol for asset in assets])
  
      folder = os.path.join(
          tempfile.gettempdir(),
          "catalyst",
          exchange_folder,
          asset_folder,
      )
      ensure_directory(folder)
  
      if name is None:
          name = "output"
  
      path = os.path.join(folder, "{}.csv".format(name))
      df.to_csv(path)
  
      return path
  
file_path: catalyst/tests/exchange/test_utils.py
imports: import os
  import tempfile
  from datetime import timedelta
  from random import randint
  import pandas
  from catalyst.assets._assets import TradingPair
  from catalyst.utils.paths import ensure_directory
label_desc: Use image node_id 4 for calling a global function with example usage: output_df(df, assets, name) and returns: path