<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def properties(self):
 """All compartment properties as a dict."""

        properties = {'id': self._id}
        if self._name is not None:
            properties['name'] = self._name

        return properties