def getembedcode(url, **kwargs):
    '''Oembed + Oohembed. Accept a URL and one of the arguments below, return dict with JSON.
    From sample on http://api.embed.ly/docs/oembed'''
    api_url = 'http://api.embed.ly/1/oembed?'
    ACCEPTED_ARGS = ['maxwidth', 'maxheight', 'format']
    params = {'url':url }

    for key, value in kwargs.items():
        if key not in ACCEPTED_ARGS:
            raise ValueError("Invalid Argument %s" % key)
        params[key] = value

    oembed_call = "%s%s" % (api_url, urllib.urlencode(params))
    result = json.loads(urllib2.urlopen(oembed_call).read())
    if result in 'html':
        return result['html']
    else:    
        return None
dataset/ETHPy150Open mikemaccana/imeveryone/usermessages.py/getembedcode/swapped operands of `in`