<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def keys(self, key=None, reverse=False):

 """sort the keys before returning them"""

        ks = sorted(list(dict.keys(self)), key=key, reverse=reverse)
        return ks