<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write_compounds(self, stream, compounds, properties=None):
 """Write iterable of compounds as YAML object to stream. Args: stream: File-like object. compounds: Iterable of compound entries. properties: Set of compound properties to output (or None to output all). """

        self._write_entries(
            stream, compounds, self.convert_compound_entry, properties)