code: def _get_scalar_default_value(dtype, default_value):
      """Gets the scalar compatible default value."""
      if dtype == tf.string:
          return default_value or ""
      elif default_value is None:
          return 0
      elif isinstance(default_value, int) or isinstance(
          default_value, float
      ):
          return default_value
      elif (
          isinstance(default_value, list)
          or isinstance(default_value, tuple)
      ) and len(default_value) == 1:
          return default_value[0]
      else:
          raise ValueError(
              "Only scalar or equivalent is allowed in default_value."
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import functools
  import six
  import tensorflow
  from tensorflow import estimator
  from google.protobuf import descriptor_pb2
  from tensorflow_ranking.python import utils
label_desc: Use image node_id 6 for calling a global function with example usage: _get_scalar_default_value(dtype, default_value) and returns: unknown, int, default_value, default_value