def most_common_words(self, k):
    '\n        Return the top-k most frequent n-grams and their frequencies in sorted order.\n        For uniform models, the frequency should be "1" for each token.\n\n        Your return should be sorted in descending order of frequency.\n        Sort according to ascending alphabet order when multiple words have same frequency.\n        :return: list[tuple(token, freq)] of top k most common tokens\n        '
    if self.uniform:
        return [(word, 1) for word in sorted(self.vocabulary)[0:k]]
    elif (self.ngram == 1):
        return sorted(self.counter_1gram.most_common(), key=(lambda x: ((- x[1]), x[0])))[0:k]
    elif (self.ngram == 2):
        return [(((token[0] + ' ') + token[1]), num) for (token, num) in sorted(self.counter_2gram.most_common(), key=(lambda x: ((- x[1]), x[0])))[0:k]]
    elif (self.ngram == 3):
        return [(((((token[0] + ' ') + token[1]) + ' ') + token[2]), num) for (token, num) in sorted(self.counter_3gram.most_common(), key=(lambda x: ((- x[1]), x[0])))[0:k]]
    return
Return the top-k most frequent n-grams and their frequencies in sorted order.
For uniform models, the frequency should be "1" for each token.

Your return should be sorted in descending order of frequency.
Sort according to ascending alphabet order when multiple words have same frequency.
:return: list[tuple(token, freq)] of top k most common tokens
def most_common_words(self, k):
    '\n        Return the top-k most frequent n-grams and their frequencies in sorted order.\n        For uniform models, the frequency should be "1" for each token.\n\n        Your return should be sorted in descending order of frequency.\n        Sort according to ascending alphabet order when multiple words have same frequency.\n        :return: list[tuple(token, freq)] of top k most common tokens\n        '
    if self.uniform:
        return [(word, 1) for word in sorted(self.vocabulary)[0:k]]
    elif (self.ngram == 1):
        return sorted(self.counter_1gram.most_common(), key=(lambda x: ((- x[1]), x[0])))[0:k]
    elif (self.ngram == 2):
        return [(((token[0] + ' ') + token[1]), num) for (token, num) in sorted(self.counter_2gram.most_common(), key=(lambda x: ((- x[1]), x[0])))[0:k]]
    elif (self.ngram == 3):
        return [(((((token[0] + ' ') + token[1]) + ' ') + token[2]), num) for (token, num) in sorted(self.counter_3gram.most_common(), key=(lambda x: ((- x[1]), x[0])))[0:k]]
    return