code: def deserialize_loss(config, use_legacy_format=False):
      if (
          "use_legacy_format"
          in inspect.getfullargspec(tf.keras.losses.deserialize).args
      ):
          return tf.keras.losses.deserialize(
              config, use_legacy_format=use_legacy_format
          )
      else:
          return tf.keras.losses.deserialize(config)
  
imports: import inspect
  import math
  from typing import Any, Callable, Dict, Iterable, Iterator, List, Mapping, Optional, Tuple, Union
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import util
  from tensorflow_metadata.proto.v0 import schema_pb2
label_desc: Use image node_id 7 for calling a global function with example usage: deserialize_loss(config, use_legacy_format) and returns: tf, tf