code: def test_encode_xmanager_component_pre_output(self):
      pre_output = hooks.XManagerComponentPreOutput(
          flags=[("flag_key", "flag_value")]
      )
      self.assertProtoEquals(
          pre_output.encode(),
          json_format.ParseDict(
              {
                  "flags": [
                      {
                          "name": "flag_key",
                          "value": {"string_value": "flag_value"},
                      }
                  ],
              },
              execution_hook_pb2.PreExecutionOutput(),
          ),
      )
  
file_path: tfx/tfx/dsl/hooks_test.py
imports: import tensorflow
  from tfx.dsl import hooks
  from tfx.proto.orchestration import execution_hook_pb2
  from google.protobuf import json_format
label_desc: Use image node_id 3 for calling the HooksTest obj's underlying member method code with example usage: obj.test_encode_xmanager_component_pre_output() without return types