code: def _convert_distance_names_to_functions(distance):
      """
      Convert function names in a composite distance function into function
      handles.
      """
      dist_out = _copy.deepcopy(distance)
  
      for i, d in enumerate(distance):
          _, dist, _ = d
          if isinstance(dist, str):
              try:
                  dist_out[i][1] = _tc.distances.__dict__[dist]
              except:
                  raise ValueError(
                      "Distance '{}' not recognized.".format(dist)
                  )
  
      return dist_out
  
file_path: turicreate/src/python/turicreate/toolkits/distances/_util.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import copy
  import array
  import six
  from operator import iadd
  import turicreate
  import sys
label_desc: Use image node_id 4 for calling a global function with example usage: _convert_distance_names_to_functions(distance) and returns: dist_out