code: def grad_chooser(ans, x, axis=None, keepdims=None):
      shape, dtype = anp.shape(x), anp.result_type(x)
  
      def vjp(g):
          """Builds gradient of functions that choose a single item, such as min or max."""
          g_repeated, _ = repeat_to_match_shape(
              g, shape, dtype, axis, keepdims
          )
          argmax_locations = (
              x
              == repeat_to_match_shape(
                  ans, shape, dtype, axis, keepdims
              )[0]
          )
          return (
              g_repeated
              * argmax_locations
              / onp.sum(argmax_locations, axis=axis, keepdims=True)
          )
  
      return vjp
  
imports: from __future__ import absolute_import
  from six import string_types
  from functools import partial
  import numpy
  from ..util import func
  from .None import numpy_wrapper
  from .numpy_boxes import ArrayBox
  from autograd.extend import primitive, vspace, defvjp, defvjp_argnum, SparseObject, VJPNode, register_notrace
label_desc: Use image node_id 15 for calling a global function with example usage: grad_chooser(ans, x, axis, keepdims) and returns: vjp, unknown