code: def dump_yaml(self, stream=None):
      from io import StringIO
  
      import ruamel.yaml
  
      spec = self.dict()
      inefficient = False
      if stream is None:
          inefficient = True
          stream = StringIO()
      yaml = ruamel.yaml.YAML()
      yaml.indent(mapping=2, sequence=4, offset=2)
      yaml.dump(spec.dict(), stream=stream)
      if inefficient:
          return stream.getvalue()
  
imports: import inspect
  import logging
  from typing import List, Optional
  from fate.components.core.essential import CROSS_VALIDATION, DEFAULT, PREDICT, TRAIN, Role, Stage
  from ._component_artifact import ArtifactDescribeAnnotation, ComponentArtifactDescribes
  from ._parameter import ComponentParameterDescribes, ParameterDescribeAnnotation
label_desc: Use image node_id 8 for calling the Component obj's underlying member method code with example usage: obj.dump_yaml(stream) and returns: stream