def get_top_n_score(listing_scores, size_n=30):
    """
    Getting the top scores and limiting number of records

    If N = 2, Get the top 2 listings based on the score
    {
        listing_id#1: score#1,
        listing_id#2: score#2
    }
    TO
    [
        [listing_id#1, score#1],
        [listing_id#2, score#2]

    ]
    """
    sorted_listing_scores = [[key, listing_scores[key]] for key in sorted(listing_scores, key=listing_scores.get, reverse=True)][:size_n]

    return sorted_listing_scores