code: def extract_transactions(perf):
      """
      Compute indexes for buy and sell transactions
  
      Parameters
      ----------
      perf: DataFrame
          The algo performance DataFrame.
  
      Returns
      -------
      DataFrame
          A DataFrame of transactions.
  
      """
      trans_list = perf.transactions.values
      all_trans = [t for sublist in trans_list for t in sublist]
      all_trans.sort(key=lambda t: t["dt"])
  
      transactions = pd.DataFrame(all_trans)
      if not transactions.empty:
          transactions.set_index("dt", inplace=True, drop=True)
      return transactions
  
imports: import copy
  import csv
  import json
  import numbers
  import os
  import time
  import numpy
  import pandas
  from catalyst.assets._assets import TradingPair
  from catalyst.exchange.utils.exchange_utils import get_algo_folder
  from catalyst.utils.paths import data_root, ensure_directory
  from operator import itemgetter
label_desc: Use image node_id 15 for calling a global function with example usage: extract_transactions(perf) and returns: transactions