def forvo(language, word, key):
from requests import get<EOL>url = '<STR_LIT>' % (word, language, key)<EOL>urls = []<EOL>page = get(url)<EOL>if page.status_code == <NUM_LIT:200>:<EOL><INDENT>if '<STR_LIT>' in page.text:<EOL><INDENT>from lltk.exceptions import IncorrectForvoAPIKey<EOL>raise IncorrectForvoAPIKey('<STR_LIT>')<EOL><DEDENT>data = page.json()<EOL>if data == ['<STR_LIT>']:<EOL><INDENT>from lltk.exceptions import DailyForvoLimitExceeded<EOL>raise DailyForvoLimitExceeded('<STR_LIT>')<EOL><DEDENT>if data.has_key('<STR_LIT>') and len(data['<STR_LIT>']):<EOL><INDENT>items = sorted(data['<STR_LIT>'], key = lambda x: int(x['<STR_LIT>']), reverse = True)<EOL>for item in items:<EOL><INDENT>urls.append(item['<STR_LIT>'])<EOL><DEDENT><DEDENT><DEDENT>return urls<EOL>
Returns a list of suitable audiosamples for a given word from Forvo.com.