Serialize an object to a YAML string.
obj (Any) – The object to serialize.
Any
SerializationError – If serialization fails.
The serialized YAML string.
str