"""Print the cumulative top of a cProfile file from `hesper.cli turn`.
Usage: python research/hesper/turn-cost/profile_top.py /tmp/turn.prof [N]
"""
import pstats
import sys

p = pstats.Stats(sys.argv[1])
p.sort_stats("cumulative").print_stats(int(sys.argv[2]) if len(sys.argv) > 2 else 28)
