def get_lastfm(method, lastfm_key='<STR_LIT>', **kwargs):
if not lastfm_key:<EOL><INDENT>if '<STR_LIT>' not in CONFIG or not CONFIG['<STR_LIT>']:<EOL><INDENT>logger.warning('<STR_LIT>')<EOL>return '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>lastfm_key = CONFIG['<STR_LIT>']<EOL><DEDENT><DEDENT>url = '<STR_LIT>'<EOL>url = url.format(method, lastfm_key)<EOL>for key in kwargs:<EOL><INDENT>url += '<STR_LIT>'.format(key, kwargs[key])<EOL><DEDENT>response = get_url(url, parser='<STR_LIT>')<EOL>if '<STR_LIT:error>' in response:<EOL><INDENT>logger.error('<STR_LIT>',<EOL>response['<STR_LIT:error>'], response['<STR_LIT:message>'])<EOL>return '<STR_LIT>'<EOL><DEDENT>return response<EOL>
Request the specified method from the lastfm api.