code: def _generate_contexts(self, metadata_handle):
      context_spec = pipeline_pb2.NodeContexts()
      text_format.Parse(
          """
          contexts {
            type {name: 'pipeline_context'}
            name {
              field_value {string_value: 'my_pipeline'}
            }
          }
          contexts {
            type {name: 'component_context'}
            name {
              field_value {string_value: 'my_component'}
            }
          }""",
          context_spec,
      )
      return context_lib.prepare_contexts(metadata_handle, context_spec)
  
imports: import copy
  from absl.testing import parameterized
  import tensorflow
  from tfx import version
  from tfx.orchestration import metadata
  from tfx.orchestration.portable import execution_publish_utils
  from tfx.orchestration.portable import outputs_utils
  from tfx.orchestration.portable.mlmd import context_lib
  from tfx.orchestration.portable.mlmd import execution_lib
  from tfx.proto.orchestration import execution_result_pb2
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.types import artifact
  from tfx.types import artifact_utils
  from tfx.types import standard_artifacts
  from tfx.utils import test_case_utils
  from google.protobuf import text_format
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 2 for calling the ExecutionPublisherTest obj's underlying member method code with example usage: obj._generate_contexts(metadata_handle) and returns: context_lib