from typing import OrderedDict


def get_top_journal_names(data, n=50, order=False):
    """Get top n journal_names by score. 

    Returns a dictionary or an `OrderedDict` if `order` is true.
    """ 
    top = sorted(data.items(), key=lambda x: x[1]['score'], reverse=True)[:n]
    if order:
        return OrderedDict(top)
    return dict(top)