code: def daily_txns_with_bar_data(transactions, market_data):
      """
      Sums the absolute value of shares traded in each name on each day.
      Adds columns containing the closing price and total daily volume for
      each day-ticker combination.
  
      Parameters
      ----------
      transactions : pd.DataFrame
          Prices and amounts of executed trades. One row per trade.
          - See full explanation in tears.create_full_tear_sheet
      market_data : pd.DataFrame
          Daily market_data
          - DataFrame has a multi-index index, one level is dates and another is
          market_data contains volume & price, equities as columns
  
      Returns
      -------
      txn_daily : pd.DataFrame
          Daily totals for transacted shares in each traded name.
          price and volume columns for close price and daily volume for
          the corresponding ticker, respectively.
      """
  
      transactions.index.name = "date"
      txn_daily = pd.DataFrame(
          transactions.assign(amount=abs(transactions.amount))
          .groupby(["symbol", pd.Grouper(freq="D")])
          .sum()["amount"]
      )
      txn_daily["price"] = market_data.xs("price", level=1).unstack()
      txn_daily["volume"] = market_data.xs("volume", level=1).unstack()
  
      txn_daily = txn_daily.reset_index().set_index("date")
  
      return txn_daily
  
file_path: pyfolio/pyfolio/capacity.py
imports: from __future__ import division
  import empyrical
  import numpy
  import pandas
  from .None import pos
label_desc: Use image node_id 1 for calling a global function with example usage: daily_txns_with_bar_data(transactions, market_data) and returns: txn_daily