code: def topk_aggregate(a, k, axis, keepdims):
      """Final aggregation function of topk
  
      Invoke topk one final time and then sort the results internally.
      """
      assert keepdims is True
      a = topk(a, k, axis, keepdims)
      axis = axis[0]
      a = np.sort(a, axis=axis)
      if k < 0:
          return a
      return a[
          tuple(
              slice(None, None, -1) if i == axis else slice(None)
              for i in range(a.ndim)
          )
      ]
  
imports: from __future__ import annotations
  import contextlib
  from collections.abc import Container, Iterable, Sequence
  from functools import wraps
  from numbers import Integral
  import numpy
  from tlz import concat
  from dask.core import flatten
label_desc: Use image node_id 5 for calling a global function with example usage: topk_aggregate(a, k, axis, keepdims) and returns: a, a