class_docstr: Reads a composable pipeline's info from its proto representation.
class_docstr_tok: ["Reads","a","composable","pipeline","'s","info","from","its","proto","representation","."]
code: def contexts(self) -> pipeline_pb2.NodeContexts:
      # A composable pipeline, when viewed as a node, stores contexts in its
      # PipelineBegin node's contexts, except that we need to strip the `_begin`
      # suffix from PipelineBegin node's `node` context.
      if not self._contexts:
          self._contexts = pipeline_pb2.NodeContexts()
          self._contexts.CopyFrom(self._begin_node.contexts)
          for context in self._contexts.contexts:
              if (
                  context.type.name
                  == compiler_constants.NODE_CONTEXT_TYPE_NAME
              ):
                  context.name.field_value.string_value = (
                      self._strip_begin_node_suffix(
                          context.name.field_value.string_value
                      )
                  )
      return self._contexts
  
imports: import abc
  from typing import Sequence, Union
  from tfx.dsl.compiler import constants
  from tfx.proto.orchestration import pipeline_pb2
  from google.protobuf import message
label_desc: Use image node_id 4 for calling the ComposablePipelineProtoView obj's underlying member method code with example usage: obj.contexts() and returns: self