<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dump(config):
 """Dumps a stacker Config object as yaml. Args: config (:class:`Config`):
 the stacker Config object. stream (stream):
 an optional stream object to write to. Returns: str: the yaml formatted stacker Config. """


    return yaml.safe_dump(
        config.to_primitive(),
        default_flow_style=False,
        encoding='utf-8',
        allow_unicode=True)