code: def as_sorted_list(options):
          
          if len(options) > 0:
              options = sorted(options, key=lambda o: o.number)
          return options
docs: Returns all options in a list sorted according to their option numbers.
  
          :return: the sorted list