code: def topk(
      a,
      k,
      axis=-1,
      largest=True,
      sorted=True,
      order=None,
      parallel_kind="auto",
      psrs_kinds=None,
      return_index=False,
  ):
      (
          a,
          k,
          axis,
          largest,
          sorted,
          order,
          parallel_kind,
          psrs_kinds,
      ) = _validate_topk_arguments(
          a, k, axis, largest, sorted, order, parallel_kind, psrs_kinds
      )
      op = TensorTopk(
          k=k,
          axis=axis,
          largest=largest,
          sorted=sorted,
          order=order,
          parallel_kind=parallel_kind,
          psrs_kinds=psrs_kinds,
          dtype=a.dtype,
          return_value=True,
          return_indices=return_index,
          stage=OperandStage.agg,
      )
      return op(a)
  
imports: import itertools
  import numpy
  from ...None import opcodes
  from ...config import options
  from ...core import ExecutableTuple, recursive_tile
  from ...core.operand import OperandStage
  from ...serialization.serializables import FieldTypes, KeyField, Int64Field, Int32Field, BoolField, StringField, ListField
  from ...utils import ceildiv, flatten
  from ..array_utils import as_same_device, device
  from ..core import TensorOrder
  from ..datasource import tensor
  from ..operands import TensorOperand, TensorOperandMixin
  from ..utils import validate_axis, validate_order
  from .sort import _validate_sort_psrs_kinds
label_desc: Use image node_id 4 for calling a global function with example usage: topk(a, k, axis, largest, sorted, order, parallel_kind, psrs_kinds, return_index) and returns: op