def lastfm_get_tree(method, **kwargs):
    for k, v in kwargs.items():
        kwargs[k] = unicode(v).encode('utf-8')
    
    url = 'http://ws.audioscrobbler.com/2.0/?api_key=%s&method=%s&%s' % (
        settings.LASTFM_API_KEY,
        method,
        urllib.urlencode(kwargs)
    )
    print url

    try:
        tree = etree.parse(url)
        return tree
    except __HOLE__:
        print "Did not work: "+url
        return None
dataset/ETHPy150Open jpic/playlistnow.fm/apps/music/lastfm_api.py/lastfm_get_tree