def most_frequent_terms(self, depth):
counts = self.term_counts()<EOL>top_terms = set(list(counts.keys())[:depth])<EOL>end_count = list(counts.values())[:depth][-<NUM_LIT:1>]<EOL>bucket = self.term_count_buckets()[end_count]<EOL>return top_terms.union(set(bucket))<EOL>
Get the X most frequent terms in the text, and then probe down to get
any other terms that have the same count as the last term.

Args:
    depth (int): The number of terms.

Returns:
    set: The set of frequent terms.