code: def _create_sparse_data(self, include_weights, weight=0.5):
      sparse_features = (
          sparse_tensor.SparseTensor(
              indices=self.feature_watched_indices,
              values=self.feature_watched_values,
              dense_shape=[self.data_batch_size, 2],
          ),
          sparse_tensor.SparseTensor(
              indices=self.feature_favorited_indices,
              values=self.feature_favorited_values,
              dense_shape=[self.data_batch_size, 2],
          ),
          sparse_tensor.SparseTensor(
              indices=self.feature_friends_indices,
              values=self.feature_friends_values,
              dense_shape=[self.data_batch_size, 3],
          ),
      )
      if include_weights:
          weights = []
          for sparse in sparse_features:
              values = (
                  array_ops.ones_like(
                      sparse.values, dtype=dtypes.float32
                  )
                  * weight
              )
              weights.append(
                  sparse_tensor.SparseTensor(
                      indices=sparse.indices,
                      values=values,
                      dense_shape=sparse.dense_shape,
                  )
              )
          sparse_features = (sparse_features, tuple(weights))
      return sparse_features
  
imports: import os
  from typing import Tuple
  from absl import flags
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.distribute import tpu_strategy
  from tensorflow.python.distribute.cluster_resolver import tpu_cluster_resolver
  from tensorflow.python.eager import remote
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import gen_math_ops
  from tensorflow.python.ops import init_ops_v2
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.platform import test
  from tensorflow.python.tpu import tpu_embedding_v2
  from tensorflow.python.tpu import tpu_embedding_v2_utils
  from tensorflow.python.util import nest
label_desc: Use image node_id 7 for calling the TPUEmbeddingBaseTest obj's underlying member method code with example usage: obj._create_sparse_data(include_weights, weight) and returns: sparse_features