nodes: 0, module; 1, function_definition; 2, function_name:_format_data; 3, parameters; 4, block; 5, identifier:self; 6, identifier:data; 7, expression_statement; 8, return_statement; 9, comment:"""
          Sort the data in blue wavelengths to red, and ignore any spectra that
          have entirely non-finite or negative fluxes.
          """; 10, list_comprehension; 11, identifier:spectrum; 12, for_in_clause; 13, if_clause; 14, identifier:spectrum; 15, line_continuation:\; 16, call; 17, call; 18, identifier:sorted; 19, argument_list; 20, attribute; 21, argument_list; 22, conditional_expression:data if isinstance(data, (list, tuple)) else [data]; 23, keyword_argument; 24, identifier:np; 25, identifier:any; 26, call; 27, identifier:data; 28, call; 29, list; 30, identifier:key; 31, lambda; 32, attribute; 33, argument_list; 34, identifier:isinstance; 35, argument_list; 36, identifier:data; 37, lambda_parameters; 38, subscript; 39, identifier:np; 40, identifier:isfinite; 41, attribute; 42, identifier:data; 43, tuple; 44, identifier:x; 45, attribute; 46, integer:0; 47, identifier:spectrum; 48, identifier:flux; 49, identifier:list; 50, identifier:tuple; 51, identifier:x; 52, identifier:disp
code: def _format_data(self, data):
          """
          Sort the data in blue wavelengths to red, and ignore any spectra that
          have entirely non-finite or negative fluxes.
          """
          return [spectrum for spectrum in \
              sorted(data if isinstance(data, (list, tuple)) else [data],
                  key=lambda x: x.disp[0]) if np.any(np.isfinite(spectrum.flux))]