code: def test_read_scalars(self):
      res = data_provider_pb2.ReadScalarsResponse()
      run = res.runs.add(run_name="test")
      tag = run.tags.add(tag_name="accuracy")
      tag.data.step.extend([0, 1, 2, 4])
      tag.data.wall_time.extend([1234.0, 1235.0, 1236.0, 1237.0])
      tag.data.value.extend([0.25, 0.50, 0.75, 1.00])
      self.stub.ReadScalars.return_value = res
  
      actual = self.provider.read_scalars(
          self.ctx,
          experiment_id="123",
          plugin_name="scalars",
          run_tag_filter=provider.RunTagFilter(runs=["test", "nope"]),
          downsample=4,
      )
      expected = {
          "test": {
              "accuracy": [
                  provider.ScalarDatum(
                      step=0, wall_time=1234.0, value=0.25
                  ),
                  provider.ScalarDatum(
                      step=1, wall_time=1235.0, value=0.50
                  ),
                  provider.ScalarDatum(
                      step=2, wall_time=1236.0, value=0.75
                  ),
                  provider.ScalarDatum(
                      step=4, wall_time=1237.0, value=1.00
                  ),
              ],
          },
      }
      self.assertEqual(actual, expected)
  
      req = data_provider_pb2.ReadScalarsRequest()
      req.experiment_id = "123"
      req.plugin_filter.plugin_name = "scalars"
      req.run_tag_filter.runs.names.extend(["nope", "test"])  # sorted
      req.downsample.num_points = 4
      self.stub.ReadScalars.assert_called_once_with(req)
  
imports: from unittest import mock
  import grpc
  import grpc_testing
  import numpy
  from tensorboard import errors
  from tensorboard import test
  from tensorboard import context
  from tensorboard.data import grpc_provider
  from tensorboard.data import provider
  from tensorboard.data.proto import data_provider_pb2
  from tensorboard.data.proto import data_provider_pb2_grpc
  from tensorboard.util import tensor_util
label_desc: Use image node_id 8 for calling the GrpcDataProviderTest obj's underlying member method code with example usage: obj.test_read_scalars() without return types