code: def pprof_equation_profile(jaxpr: core.Jaxpr) -> bytes:
      """Generates a pprof profile that maps jaxpr equations to Python stack traces.
  
      By visualizing the profile using pprof, one can identify Python code that is
      responsible for yielding large numbers of jaxpr equations.
  
      Args:
        jaxpr: a Jaxpr.
  
      Returns:
        A gzip-compressed pprof Profile protocol buffer, suitable for passing to
        pprof tool for visualization.
      """
      d = Counter(
          (eqn.source_info.traceback, eqn.primitive)
          for _, eqn in all_eqns(jaxpr)
      )
      return _pprof_profile(d)
  
imports: from __future__ import annotations
  from collections import Counter, defaultdict
  import gzip
  import itertools
  import json
  import types
  from typing import Any, Callable, Union
  from jax._src import core
  from jax._src import util
  from jax._src import source_info_util
  from jax._src.lib import xla_client
label_desc: Use image node_id 12 for calling a global function with example usage: pprof_equation_profile(jaxpr) and returns: _pprof_profile