def stream_experiment_data(request, **kwargs):
    self.assertEqual(request.experiment_id, '789')
    self.assertEqual(kwargs['metadata'], grpc_util.version_metadata())
    for run in ('train', 'test'):
        for tag in ('accuracy', 'loss'):
            response = export_service_pb2.StreamExperimentDataResponse()
            response.run_name = run
            response.tag_name = tag
            display_name = ('%s:%s' % (request.experiment_id, tag))
            response.tag_metadata.CopyFrom(test_util.scalar_metadata(display_name))
            for step in range(10):
                response.points.steps.append(step)
                if (tag == 'loss'):
                    if (run == 'train'):
                        value = (1.0 / (step + 1))
                        seconds = step
                    else:
                        value = ((- 1.0) / (step + 1))
                        seconds = (600 + step)
                elif (run == 'train'):
                    value = (1.0 / (10 - step))
                    seconds = (step * 2)
                else:
                    value = ((- 1.0) / (10 - step))
                    seconds = (600 + (step * 2))
                response.points.values.append(value)
                response.points.wall_times.add(seconds=seconds, nanos=0)
            (yield response)
def stream_experiment_data(request, **kwargs):
    self.assertEqual(request.experiment_id, '789')
    self.assertEqual(kwargs['metadata'], grpc_util.version_metadata())
    for run in ('train', 'test'):
        for tag in ('accuracy', 'loss'):
            response = export_service_pb2.StreamExperimentDataResponse()
            response.run_name = run
            response.tag_name = tag
            display_name = ('%s:%s' % (request.experiment_id, tag))
            response.tag_metadata.CopyFrom(test_util.scalar_metadata(display_name))
            for step in range(10):
                response.points.steps.append(step)
                if (tag == 'loss'):
                    if (run == 'train'):
                        value = (1.0 / (step + 1))
                        seconds = step
                    else:
                        value = ((- 1.0) / (step + 1))
                        seconds = (600 + step)
                elif (run == 'train'):
                    value = (1.0 / (10 - step))
                    seconds = (step * 2)
                else:
                    value = ((- 1.0) / (10 - step))
                    seconds = (600 + (step * 2))
                response.points.values.append(value)
                response.points.wall_times.add(seconds=seconds, nanos=0)
            (yield response)