class_docstr: Tests for _get_example_value_presence.
class_docstr_tok: ["Tests","for","_get_example_value_presence","."]
code: def test_example_value_presence_weighted(self):
      t = pa.RecordBatch.from_arrays(
          [
              pa.array([[1], [1, 1], [1, 2], [2]]),
              pa.array([[0.5], [1.0], [1.5], [2.0]]),
          ],
          ["x", "w"],
      )
      expected_df = pd.DataFrame(
          {
              "values": [1, 1, 1, 2, 2],
              "weights": [0.5, 1.0, 1.5, 1.5, 2.0],
          },
          index=pd.Index([0, 1, 2, 2, 3], name="example_indices"),
      )
      pd.testing.assert_frame_equal(
          expected_df,
          _get_example_value_presence_as_dataframe(
              t,
              types.FeaturePath(["x"]),
              boundaries=None,
              weight_column_name="w",
          ),
      )
  
imports: from typing import Optional, Sequence, Text
  from absl.testing import absltest
  import apache_beam
  import numpy
  import pandas
  import pyarrow
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import lift_stats_generator
  from tensorflow_data_validation.utils import test_util
  from tensorflow_data_validation.utils.example_weight_map import ExampleWeightMap
  from google.protobuf import text_format
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 2 for calling the GetExampleValuePresenceTest obj's underlying member method code with example usage: obj.test_example_value_presence_weighted() without return types