<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def command2str(num):
 """ Turn command number into name """

    for attr in SLOT.__dict__.keys():
        if not attr.startswith('_') and attr == attr.upper():
            if getattr(SLOT, attr) == num:
                return 'SLOT_%s' % attr

    return "0x%02x" % (num)