code: def agg_all_long_short(round_trips, col, stats_dict):
      stats_all = (
          round_trips.assign(ones=1)
          .groupby("ones")[col]
          .agg(stats_dict)
          .T.rename(columns={1.0: "All trades"})
      )
      stats_long_short = (
          round_trips.groupby("long")[col]
          .agg(stats_dict)
          .T.rename(
              columns={False: "Short trades", True: "Long trades"}
          )
      )
  
      return stats_all.join(stats_long_short)
  
file_path: pyfolio/pyfolio/round_trips.py
imports: from __future__ import division
  from math import copysign
  import warnings
  from collections import deque, OrderedDict
  import pandas
  import numpy
  from .utils import print_table, format_asset
label_desc: Use image node_id 1 for calling a global function with example usage: agg_all_long_short(round_trips, col, stats_dict) and returns: stats_all