code: def sample_weight_shape_match(v, sample_weight):
      if sample_weight is None:
          return tf.ones_like(v)
      if np.size(sample_weight) == 1:
          return tf.fill(v.shape, sample_weight)
      return tf.convert_to_tensor(sample_weight)
  
file_path: addons/tensorflow_addons/metrics/utils.py
imports: import numpy
  import tensorflow
  from tensorflow_addons.utils.types import AcceptableDTypes
  from typeguard import typechecked
  from typing import Optional, Callable
label_desc: Use image node_id 2 for calling a global function with example usage: sample_weight_shape_match(v, sample_weight) and returns: tf, tf, tf