code: def test_txn_pnl_matches_round_trip_pnl(self):
      __location__ = os.path.realpath(
          os.path.join(os.getcwd(), os.path.dirname(__file__))
      )
  
      test_txn = read_csv(
          gzip.open(__location__ + "/test_data/test_txn.csv.gz"),
          index_col=0,
          parse_dates=True,
      )
      test_pos = read_csv(
          gzip.open(__location__ + "/test_data/test_pos.csv.gz"),
          index_col=0,
          parse_dates=True,
      )
  
      transactions_closed = add_closing_transactions(test_pos, test_txn)
      transactions_closed["txn_dollars"] = (
          transactions_closed.amount * -1.0 * transactions_closed.price
      )
      round_trips = extract_round_trips(transactions_closed)
  
      self.assertAlmostEqual(
          round_trips.pnl.sum(), transactions_closed.txn_dollars.sum()
      )
  
file_path: pyfolio/pyfolio/tests/test_round_trips.py
imports: from nose_parameterized import parameterized
  from unittest import TestCase
  from pandas import Series, DataFrame, DatetimeIndex, date_range, Timedelta, read_csv
  from pandas.util.testing import assert_frame_equal
  import os
  import gzip
  from pyfolio.round_trips import extract_round_trips, add_closing_transactions, _groupby_consecutive
label_desc: Use image node_id 4 for calling the RoundTripTestCase obj's underlying member method code with example usage: obj.test_txn_pnl_matches_round_trip_pnl() without return types