code: def _minmax_impl(
      a_gpu, axis, min_or_max, stream=None, keepdims=False
  ):
      """Returns both max and argmax (min/argmin) along an axis."""
      assert len(a_gpu.shape) < 3
      if iscomplextype(a_gpu.dtype):
          raise ValueError("Cannot compute min/max of complex values")
  
      if (
          axis is None or len(a_gpu.shape) <= 1
      ):  ## Note: PyCUDA doesn't have an overall argmax/argmin!
          out_shape = (1,) * len(a_gpu.shape)
          if min_or_max == "max":
              return gpuarray.max(a_gpu).reshape(out_shape), None
          else:
              return gpuarray.min(a_gpu).reshape(out_shape), None
      else:
          if axis < 0:
              axis += 2
      assert axis in (0, 1)
  
      global _global_cublas_allocator
      alloc = _global_cublas_allocator
  
      n, m = (
          a_gpu.shape
          if a_gpu.flags.c_contiguous
          else (a_gpu.shape[1], a_gpu.shape[0])
      )
      col_kernel, row_kernel = _get_minmax_kernel(
          a_gpu.dtype, min_or_max
      )
      if (axis == 0 and a_gpu.flags.c_contiguous) or (
          axis == 1 and a_gpu.flags.f_contiguous
      ):
          if keepdims:
              out_shape = (1, m) if axis == 0 else (m, 1)
          else:
              out_shape = (m,)
          target = gpuarray.empty(
              out_shape, dtype=a_gpu.dtype, allocator=alloc
          )
          idx = gpuarray.empty(
              out_shape, dtype=np.uint32, allocator=alloc
          )
          col_kernel(
              a_gpu,
              target,
              idx,
              np.uint32(m),
              np.uint32(n),
              block=(32, 1, 1),
              grid=(m, 1, 1),
              stream=stream,
          )
      else:
          if keepdims:
              out_shape = (1, n) if axis == 0 else (n, 1)
          else:
              out_shape = (n,)
          target = gpuarray.empty(
              out_shape, dtype=a_gpu, allocator=alloc
          )
          idx = gpuarray.empty(
              out_shape, dtype=np.uint32, allocator=alloc
          )
          row_kernel(
              a_gpu,
              target,
              idx,
              np.uint32(m),
              np.uint32(n),
              block=(32, 1, 1),
              grid=(n, 1, 1),
              stream=stream,
          )
      return target, idx
  
imports: from __future__ import absolute_import, division
  import atexit
  import numbers
  from string import Template
  import pycuda.driver
  import pycuda.gpuarray
  import pycuda.elementwise
  import pycuda.reduction
  import pycuda.scan
  import pycuda.tools
  from pycuda.tools import context_dependent_memoize, dtype_to_ctype
  from pycuda.compiler import SourceModule
  from pytools import memoize
  import numpy
  from .None import cuda
  from .None import cublas
  import sys
  import operator
label_desc: Use image node_id 37 for calling a global function with example usage: _minmax_impl(a_gpu, axis, min_or_max, stream, keepdims) and returns: target,  idx, gpuarray,  None, gpuarray,  None