nodes: 0, module; 1, function_definition; 2, function_name:as_sorted_list; 3, parameters; 4, block; 5, identifier:options; 6, expression_statement; 7, if_statement; 8, return_statement; 9, comment:"""
          Returns all options in a list sorted according to their option numbers.
  
          :return: the sorted list
          """; 10, comparison_operator:len(options) > 0; 11, block; 12, identifier:options; 13, call; 14, integer:0; 15, expression_statement; 16, identifier:len; 17, argument_list; 18, assignment; 19, identifier:options; 20, identifier:options; 21, call; 22, identifier:sorted; 23, argument_list; 24, identifier:options; 25, keyword_argument; 26, identifier:key; 27, lambda; 28, lambda_parameters; 29, attribute; 30, identifier:o; 31, identifier:o; 32, identifier:number
code: def as_sorted_list(options):
          """
          Returns all options in a list sorted according to their option numbers.
  
          :return: the sorted list
          """
          if len(options) > 0:
              options = sorted(options, key=lambda o: o.number)
          return options