code: def argmin(arr, f):
      """Return the index, i, in arr that minimizes f(arr[i])
  
      Args:
          arr:
          f:
      """
      m = None
      i = None
      for idx, item in enumerate(arr):
          if item is not None:
              if m is None or f(item) < m:
                  m = f(item)
                  i = idx
      return i
  
file_path: sagemaker-python-sdk/src/sagemaker/logs.py
imports: from __future__ import absolute_import
  import collections
  import functools
  import os
  import sys
label_desc: Use image node_id 1 for calling a global function with example usage: argmin(arr, f) and returns: i