code: def _fill_in_missing(x):
      """Replace missing values in a SparseTensor.
  
      Fills in missing values of `x` with '' or 0, and converts to a dense tensor.
  
      Args:
        x: A `SparseTensor` of rank 2.  Its dense shape should have size at most 1
          in the second dimension.
  
      Returns:
        A rank 1 tensor where missing values of `x` have been filled in.
      """
      if not isinstance(x, tf.sparse.SparseTensor):
          return x
  
      default_value = "" if x.dtype == tf.string else 0
      return tf.squeeze(
          tf.sparse.to_dense(
              tf.SparseTensor(
                  x.indices, x.values, [x.dense_shape[0], 1]
              ),
              default_value,
          ),
          axis=1,
      )
  
imports: import tensorflow
  import tensorflow_transform
  from tfx.experimental.templates.taxi.models import features
label_desc: Use image node_id 1 for calling a global function with example usage: _fill_in_missing(x) and returns: tf, x