import six


def sorted_files(pdict):
    """
    Returns the file_summary information sorted in reverse order based on duration

    :param pdict: profile dict

    :return: sorted list of file_summary dicts
    """
    return sorted([v['file_summary'] for k, v in six.iteritems(pdict) if k != 'summary'],
                  key=lambda f: f['duration'], reverse=True)