code: def _construct_auto_distance(
      feature_names, column_names, column_types, sample
  ):
      """
      Construct composite distance parameters based on selected features and their
      types.
      """
  
      ## Make a dictionary from the column_names and column_types
      col_type_dict = {k: v for k, v in zip(column_names, column_types)}
  
      ## Loop through feature names, appending a distance component if the
      #  feature's type is *not* numeric. If the type *is* numeric, append it to
      #  the numeric_cols list, then at the end make a numeric columns distance
      #  component.
      composite_distance_params = []
      numeric_cols = []
  
      for c in feature_names:
          if col_type_dict[c] == str:
              composite_distance_params.append(
                  [[c], _turicreate.distances.levenshtein, 1]
              )
          elif col_type_dict[c] == dict:
              composite_distance_params.append(
                  [[c], _turicreate.distances.jaccard, 1]
              )
          elif col_type_dict[c] == array.array:
              composite_distance_params.append(
                  [[c], _turicreate.distances.euclidean, 1]
              )
          elif col_type_dict[c] == list:
              only_str_lists = _validate_lists(
                  sample[c], allowed_types=[str]
              )
              if not only_str_lists:
                  raise TypeError(
                      "Only lists of all str objects are currently supported"
                  )
              composite_distance_params.append(
                  [[c], _turicreate.distances.jaccard, 1]
              )
          elif col_type_dict[c] in [int, float, array.array, list]:
              numeric_cols.append(c)
          else:
              raise TypeError(
                  "Unable to automatically determine a distance "
                  + "for column {}".format(c)
              )
  
      # Make the standalone numeric column distance component
      if len(numeric_cols) > 0:
          composite_distance_params.append(
              [numeric_cols, _turicreate.distances.euclidean, 1]
          )
  
      return composite_distance_params
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import turicreate
  from turicreate.toolkits._model import Model
  from turicreate.data_structures.sgraph import SGraph
  import turicreate.toolkits._internal_utils
  from turicreate.toolkits._private_utils import _validate_row_label
  from turicreate.toolkits._private_utils import _validate_lists
  from turicreate.toolkits._private_utils import _robust_column_name
  from turicreate.toolkits._main import ToolkitError
  from turicreate.toolkits.distances._util import _convert_distance_names_to_functions
  from turicreate.toolkits.distances._util import _validate_composite_distance
  from turicreate.toolkits.distances._util import _scrub_composite_distance_features
  from turicreate.toolkits.distances._util import _get_composite_distance_features
  from turicreate._cython.cy_server import QuietProgress
  import array
  import copy
  import six
label_desc: Use image node_id 1 for calling a global function with example usage: _construct_auto_distance(feature_names, column_names, column_types, sample) and returns: composite_distance_params