nodes: 0, module; 1, function_definition; 2, function_name:sort; 3, parameters; 4, block; 5, identifier:self; 6, identifier:key; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, for_statement; 11, return_statement; 12, identifier:reverse; 13, False; 14, identifier:none_greater; 15, False; 16, string:'''Sort the list in the order of the dictionary key.
  
          Example of use:
  
          >>> test = [
          ...    {"name": "Jim",   "age": 18, "income": 93000, "wigs": 68       },
          ...    {"name": "Larry", "age": 18,                  "wigs": [3, 2, 9]},
          ...    {"name": "Joe",   "age": 20, "income": 15000, "wigs": [1, 2, 3]},
          ...    {"name": "Bill",  "age": 19, "income": 29000                   },
          ... ]
          >>> print PLOD(test).sort("name").returnString()
          [
              {age: 19, income: 29000, name: 'Bill' , wigs: None     },
              {age: 18, income: 93000, name: 'Jim'  , wigs:        68},
              {age: 20, income: 15000, name: 'Joe'  , wigs: [1, 2, 3]},
              {age: 18, income: None , name: 'Larry', wigs: [3, 2, 9]}
          ]
          >>> print PLOD(test).sort("income").returnString()
          [
              {age: 18, income: None , name: 'Larry', wigs: [3, 2, 9]},
              {age: 20, income: 15000, name: 'Joe'  , wigs: [1, 2, 3]},
              {age: 19, income: 29000, name: 'Bill' , wigs: None     },
              {age: 18, income: 93000, name: 'Jim'  , wigs:        68}
          ]
          >>> print PLOD(test).sort(["age", "income"]).returnString()
          [
              {age: 18, income: None , name: 'Larry', wigs: [3, 2, 9]},
              {age: 18, income: 93000, name: 'Jim'  , wigs:        68},
              {age: 19, income: 29000, name: 'Bill' , wigs: None     },
              {age: 20, income: 15000, name: 'Joe'  , wigs: [1, 2, 3]}
          ]
          
          .. versionadded:: 0.0.2
          
          :param key:
             A dictionary key (or a list of keys) that should be the
             basis of the sorting.
          :param reverse:
             Defaults to False. If True, then list is sorted decrementally.
          :param none_greater:
             Defaults to False. If True, then entries missing the key/value
             pair are considered be of greater value than the non-missing values.
          :returns: self
          '''; 17, identifier:i; 18, call; 19, block; 20, identifier:self; 21, identifier:range; 22, argument_list; 23, expression_statement; 24, for_statement; 25, if_statement; 26, integer:0; 27, call; 28, assignment; 29, identifier:j; 30, call; 31, block; 32, comparison_operator:i!=min; 33, block; 34, identifier:len; 35, argument_list; 36, identifier:min; 37, identifier:i; 38, identifier:range; 39, argument_list; 40, if_statement; 41, identifier:i; 42, identifier:min; 43, expression_statement; 44, comment:# swap; 45, expression_statement; 46, comment:# swap; 47, attribute; 48, binary_operator:i + 1; 49, call; 50, call; 51, block; 52, assignment; 53, assignment; 54, identifier:self; 55, identifier:table; 56, identifier:i; 57, integer:1; 58, identifier:len; 59, argument_list; 60, attribute; 61, argument_list; 62, expression_statement; 63, pattern_list; 64, expression_list; 65, pattern_list; 66, expression_list; 67, attribute; 68, identifier:internal; 69, identifier:is_first_lessor; 70, subscript; 71, subscript; 72, identifier:key; 73, keyword_argument; 74, keyword_argument; 75, assignment; 76, subscript; 77, subscript; 78, subscript; 79, subscript; 80, subscript; 81, subscript; 82, subscript; 83, subscript; 84, identifier:self; 85, identifier:table; 86, attribute; 87, identifier:j; 88, attribute; 89, identifier:min; 90, identifier:none_greater; 91, identifier:none_greater; 92, identifier:reverse; 93, identifier:reverse; 94, identifier:min; 95, identifier:j; 96, attribute; 97, identifier:i; 98, attribute; 99, identifier:min; 100, attribute; 101, identifier:min; 102, attribute; 103, identifier:i; 104, attribute; 105, identifier:i; 106, attribute; 107, identifier:min; 108, attribute; 109, identifier:min; 110, attribute; 111, identifier:i; 112, identifier:self; 113, identifier:table; 114, identifier:self; 115, identifier:table; 116, identifier:self; 117, identifier:table; 118, identifier:self; 119, identifier:table; 120, identifier:self; 121, identifier:table; 122, identifier:self; 123, identifier:table; 124, identifier:self; 125, identifier:index_track; 126, identifier:self; 127, identifier:index_track; 128, identifier:self; 129, identifier:index_track; 130, identifier:self; 131, identifier:index_track
code: def sort(self, key, reverse=False, none_greater=False):
          '''Sort the list in the order of the dictionary key.
  
          Example of use:
  
          >>> test = [
          ...    {"name": "Jim",   "age": 18, "income": 93000, "wigs": 68       },
          ...    {"name": "Larry", "age": 18,                  "wigs": [3, 2, 9]},
          ...    {"name": "Joe",   "age": 20, "income": 15000, "wigs": [1, 2, 3]},
          ...    {"name": "Bill",  "age": 19, "income": 29000                   },
          ... ]
          >>> print PLOD(test).sort("name").returnString()
          [
              {age: 19, income: 29000, name: 'Bill' , wigs: None     },
              {age: 18, income: 93000, name: 'Jim'  , wigs:        68},
              {age: 20, income: 15000, name: 'Joe'  , wigs: [1, 2, 3]},
              {age: 18, income: None , name: 'Larry', wigs: [3, 2, 9]}
          ]
          >>> print PLOD(test).sort("income").returnString()
          [
              {age: 18, income: None , name: 'Larry', wigs: [3, 2, 9]},
              {age: 20, income: 15000, name: 'Joe'  , wigs: [1, 2, 3]},
              {age: 19, income: 29000, name: 'Bill' , wigs: None     },
              {age: 18, income: 93000, name: 'Jim'  , wigs:        68}
          ]
          >>> print PLOD(test).sort(["age", "income"]).returnString()
          [
              {age: 18, income: None , name: 'Larry', wigs: [3, 2, 9]},
              {age: 18, income: 93000, name: 'Jim'  , wigs:        68},
              {age: 19, income: 29000, name: 'Bill' , wigs: None     },
              {age: 20, income: 15000, name: 'Joe'  , wigs: [1, 2, 3]}
          ]
          
          .. versionadded:: 0.0.2
          
          :param key:
             A dictionary key (or a list of keys) that should be the
             basis of the sorting.
          :param reverse:
             Defaults to False. If True, then list is sorted decrementally.
          :param none_greater:
             Defaults to False. If True, then entries missing the key/value
             pair are considered be of greater value than the non-missing values.
          :returns: self
          '''
          for i in range(0, len(self.table)):
              min = i
              for j in range(i + 1, len(self.table)):
                  if internal.is_first_lessor(self.table[j], self.table[min], key, none_greater=none_greater, reverse=reverse):
                      min = j
              if i!=min:
                  self.table[i], self.table[min] = self.table[min], self.table[i] # swap
                  self.index_track[i], self.index_track[min] = self.index_track[min], self.index_track[i] # swap
          return self