code: def loss_and_metric_and_predictions_fn(provider):
      """Helper function to create loss and metric fns."""
      metric_fn = None
      loss_fn = None
      predictions_fn = None
      if getattr(provider, "get_metric_fn", None) is not None:
          metric_fn = provider.get_metric_fn()
      if getattr(provider, "get_loss_fn", None) is not None:
          loss_fn = provider.get_loss_fn()
      if getattr(provider, "get_predictions_fn", None) is not None:
          predictions_fn = provider.get_predictions_fn()
  
      return (loss_fn, metric_fn, predictions_fn)
  
imports: import contextlib
  import copy
  import json
  import os
  import random
  from absl import flags
  from absl import logging
  import keras_tuner
  from model_search import hparam
  from model_search import phoenix
  from model_search import registry
  from model_search.data import data
  from model_search.metadata import ml_metadata_db
  from model_search.proto import phoenix_spec_pb2
  import tensorflow.compat.v2
  from google.protobuf import text_format
label_desc: Use image node_id 3 for calling a global function with example usage: loss_and_metric_and_predictions_fn(provider) and returns: loss_fn,  metric_fn,  predictions_fn