code: def keylist(self):
          
          items = self.enumerations.items()
          items.sort(lambda a, b: self.cmp(a[1], b[1]))
  
          # last item has highest value
          rslt = [None] * (items[-1][1] + 1)
  
          # map the values
          for key, value in items:
              rslt[value] = key
  
          # return the result
          return rslt
docs: Return a list of names in order by value.