(data_files, option, descending=True)
return new_list
Sort the list of data files by metadata.
Sort the list of data files by metadata.
Sort the list of data files by metadata .
def _sort_data_list(data_files, option, descending=True):
    """Sort the list of data files by metadata."""
    option_name, option_default, option_type, _ = SORT_OPTIONS[option]
    new_list = sorted(data_files, key=lambda k: option_type(data_files[k].get(option_name, option_default)))
    if descending:
        new_list = new_list[::-1]
    return new_list
def _sort_data_list ( data_files , option , descending = True ) : option_name , option_default , option_type , _ = SORT_OPTIONS [ option ] new_list = sorted ( data_files , key = lambda k : option_type ( data_files [ k ] . get ( option_name , option_default ) ) ) if descending : new_list = new_list [ : : - 1 ] return new_list