nodes: 0, module; 1, function_definition; 2, function_name:get_elementary_intervals; 3, parameters; 4, block; 5, identifier:self; 6, identifier:features; 7, expression_statement; 8, expression_statement; 9, try_statement; 10, expression_statement; 11, expression_statement; 12, return_statement; 13, comment:"""Generates a sorted list of elementary intervals"""; 14, assignment; 15, block; 16, except_clause; 17, assignment; 18, call; 19, identifier:coords; 20, identifier:coords; 21, list; 22, for_statement; 23, identifier:IndexError; 24, block; 25, identifier:coords; 26, call; 27, attribute; 28, argument_list; 29, identifier:interval; 30, identifier:features; 31, block; 32, raise_statement; 33, identifier:list; 34, argument_list; 35, identifier:coords; 36, identifier:sort; 37, if_statement; 38, expression_statement; 39, call; 40, call; 41, comparison_operator:len(interval) != 3; 42, block; 43, call; 44, identifier:SyntaxError; 45, argument_list; 46, identifier:set; 47, argument_list; 48, call; 49, integer:3; 50, raise_statement; 51, attribute; 52, argument_list; 53, binary_operator:'Interval malformed %s. Allways specify start and end position for interval.' % str(interval); 54, identifier:coords; 55, identifier:len; 56, argument_list; 57, call; 58, identifier:coords; 59, identifier:extend; 60, list; 61, string; 62, call; 63, identifier:interval; 64, identifier:SyntaxError; 65, argument_list; 66, subscript; 67, subscript; 68, string_content:Interval malformed %s. Allways specify start and end position for interval.; 69, identifier:str; 70, argument_list; 71, binary_operator:'Interval malformed %s. Allways specify start and end position for interval.' % str(interval); 72, identifier:interval; 73, integer:0; 74, identifier:interval; 75, integer:1; 76, identifier:interval; 77, string; 78, call; 79, string_content:Interval malformed %s. Allways specify start and end position for interval.; 80, identifier:str; 81, argument_list; 82, identifier:interval
code: def get_elementary_intervals(self, features):
          """Generates a sorted list of elementary intervals"""
          coords = []
          try:
              for interval in features:
                  if len(interval) != 3:
                      raise SyntaxError('Interval malformed %s. Allways specify start and end position for interval.' % str(interval))
                  coords.extend([interval[0],interval[1]])    
          except IndexError:
              raise SyntaxError('Interval malformed %s. Allways specify start and end position for interval.' % str(interval))
          coords = list(set(coords))
          coords.sort()
          return coords