def languages(self):
language = PageView.headers['<STR_LIT>']<EOL>first_language = fn.SubStr(<EOL>language,  <EOL><NUM_LIT:1>,  <EOL>fn.StrPos(language, '<STR_LIT:;>'))<EOL>return (self.get_query()<EOL>.select(first_language, fn.Count(PageView.id))<EOL>.group_by(first_language)<EOL>.order_by(fn.Count(PageView.id).desc())<EOL>.tuples())<EOL>
Retrieve languages, sorted by most common to least common. The
Accept-Languages header sometimes looks weird, i.e.
"en-US,en;q=0.8,is;q=0.6,da;q=0.4" We will split on the first semi-
colon.