code: def _fill_in_missing(x):
      """Replace missing values in a SparseTensors.
  
      If x is a SparseTensors, fills in missing values of `x` with '' or 0, and
      converts to a dense tensor. Otherwise it returns x as is.
  
      Args:
        x: A `SparseTensor` of rank 2 or a tensor that is not an instance of
          `SparseTensor`.  If input is a `SparseTensor` 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, or x as is
        if x is not an instance of `SparseTensor`
      """
      if not isinstance(x, tf.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,
      )
  
file_path: tfx/tfx/examples/bigquery_ml/taxi_utils_bqml.py
imports: from typing import List
  import tensorflow
  from tensorflow import estimator
  import tensorflow_model_analysis
  import tensorflow_transform
  from tensorflow_transform.tf_metadata import schema_utils
  from tfx.components.trainer.fn_args_utils import DataAccessor
  from tfx_bsl.tfxio import dataset_options
label_desc: Use image node_id 4 for calling a global function with example usage: _fill_in_missing(x) and returns: tf, x