<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sorted_conkeys(self, prefix=None):
 """Return all condition keys in self.conditions as a list sorted suitable for print or write to a file. If prefix is given return only the ones prefixed with prefix."""


        # Make for defined and sorted output:
        conkeys = []
        for cond in _COND_PREFIXES:
            conkeys += sorted([key for key in self.conditions
                               if key.startswith(cond)], key=self.cond_int)
        if not prefix:
            return conkeys
        return [key for key in conkeys if key.startswith(prefix)]