def sort_arbitrarily_ordered_nexson(blob):
    """Primarily used for testing (getting nice diffs). Calls
    sort_meta_elements and then sorts otu, node and edge list by id
    """
    # otu, node and edge elements have no necessary orger in v0.0 or v1.0
    v = detect_nexson_version(blob)
    nex = get_nexml_el(blob)
    if _is_by_id_hbf(v):
        return blob
    sort_meta_elements(blob)
    for ob in _get_index_list_of_values(nex, 'otus'):
        _inplace_sort_by_id(ob.get('otu', []))
    for tb in _get_index_list_of_values(nex, 'trees'):
        for tree in _get_index_list_of_values(tb, 'tree'):
            _inplace_sort_by_id(tree.get('node', []))
            _inplace_sort_by_id(tree.get('edge', []))
    return blob
def sort_arbitrarily_ordered_nexson ( blob ) : v = detect_nexson_version ( blob ) nex = get_nexml_el ( blob ) if _is_by_id_hbf ( v ) : return blob sort_meta_elements ( blob ) for ob in _get_index_list_of_values ( nex , 'otus' ) : _inplace_sort_by_id ( ob . get ( 'otu' , [ ] ) ) for tb in _get_index_list_of_values ( nex , 'trees' ) : for tree in _get_index_list_of_values ( tb , 'tree' ) : _inplace_sort_by_id ( tree . get ( 'node' , [ ] ) ) _inplace_sort_by_id ( tree . get ( 'edge' , [ ] ) ) return blob
Primarily used for testing (getting nice diffs). Calls
    sort_meta_elements and then sorts otu, node and edge list by id