Function for converting YAML from different types of sources.