MCPcopy Create free account
hub / github.com/aws/aws-cli / dump_yaml_to_str

Function dump_yaml_to_str

awscli/utils.py:478–489  ·  view source on GitHub ↗

Dump a Python object to a YAML-formatted string. :type yaml: ruamel.yaml.YAML :param yaml: An instance of ruamel.yaml.YAML. :type data: object :param data: A Python object that can be dumped to YAML.

(yaml, data)

Source from the content-addressed store, hash-verified

476
477
478def dump_yaml_to_str(yaml, data):
479 """Dump a Python object to a YAML-formatted string.
480
481 :type yaml: ruamel.yaml.YAML
482 :param yaml: An instance of ruamel.yaml.YAML.
483
484 :type data: object
485 :param data: A Python object that can be dumped to YAML.
486 """
487 stream = StringIO()
488 yaml.dump(data, stream)
489 return stream.getvalue()
490
491
492class SafeLineBreakEmitter(ruamel.yaml.emitter.Emitter):

Callers 6

test_dump_to_strMethod · 0.90
test_input_yaml_bytesMethod · 0.90
ordered_yaml_dumpFunction · 0.90
yaml_dumpFunction · 0.90

Calls 2

dumpMethod · 0.45
getvalueMethod · 0.45