code: def argsort(a: NdarrayTensor, axis: int | None = -1) -> NdarrayTensor:
      """`np.argsort` with equivalent implementation for torch.
  
      Args:
          a: the array/tensor to sort.
          axis: axis along which to sort.
  
      Returns:
          Array/Tensor of indices that sort a along the specified axis.
      """
      if isinstance(a, np.ndarray):
          return np.argsort(a, axis=axis)  # type: ignore
      return torch.argsort(a, dim=axis)
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  from typing import TypeVar
  import numpy
  import torch
  from monai.config.type_definitions import NdarrayOrTensor, NdarrayTensor
  from monai.utils.misc import is_module_ver_at_least
  from monai.utils.type_conversion import convert_data_type, convert_to_dst_type
label_desc: Use image node_id 8 for calling a global function with example usage: argsort(a, axis) and returns: torch, np