(self)
return ordered_meta
Get a nicer representation of _metadata. Will sort keys, but put the
        top-level fields 'global', 'captures', 'annotations' in front.

        Returns
        -------
        ordered_meta : OrderedDict
            Cleaner representation of _metadata with top-level keys correctly
            ordered and the rest of the keys sorted.
Get a nicer representation of _metadata. Will sort keys, but put the
        top-level fields 'global', 'captures', 'annotations' in front.
Get a nicer representation of _metadata . Will sort keys but put the top - level fields global captures annotations in front .
def ordered_metadata(self):
        '''
        Get a nicer representation of _metadata. Will sort keys, but put the
        top-level fields 'global', 'captures', 'annotations' in front.

        Returns
        -------
        ordered_meta : OrderedDict
            Cleaner representation of _metadata with top-level keys correctly
            ordered and the rest of the keys sorted.
        '''
        ordered_meta = OrderedDict()
        top_sort_order = ['global', 'captures', 'annotations']
        for top_key in top_sort_order:
            assert top_key in self._metadata
            ordered_meta[top_key] = json.loads(json.dumps(self._metadata[top_key], sort_keys=True))
        # If there are other top-level keys, they go later
        # TODO: sort potential `other` top-level keys
        for oth_key, oth_val in self._metadata.items():
            if oth_key not in top_sort_order:
                ordered_meta[oth_key] = json.loads(json.dumps(oth_val, sort_keys=True))
        return ordered_meta
def ordered_metadata ( self ) : ordered_meta = OrderedDict ( ) top_sort_order = [ 'global' , 'captures' , 'annotations' ] for top_key in top_sort_order : assert top_key in self . _metadata ordered_meta [ top_key ] = json . loads ( json . dumps ( self . _metadata [ top_key ] , sort_keys = True ) ) # If there are other top-level keys, they go later # TODO: sort potential `other` top-level keys for oth_key , oth_val in self . _metadata . items ( ) : if oth_key not in top_sort_order : ordered_meta [ oth_key ] = json . loads ( json . dumps ( oth_val , sort_keys = True ) ) return ordered_meta