def jdumps(obj, encoding='utf-8'):
    """
    XBMC is currently not fully compliant to the JSON-RPC 2.0 spec.
    When a single argument is passed an array with one element
    should be provied according to the spec, however XBMC expects a
    single value in this case.
    
    See http://forum.xbmc.org/showpost.php?p=671587&postcount=591
    """
    if obj in 'params' and len(obj['params']) == 1:
        obj['params'] = obj['params'][0]
    
    # Do 'serialize' test at some point for other classes
    global cjson
    if cjson:
        return cjson.encode(obj)
    else:
        return json.dumps(obj, encoding=encoding)
dataset/ETHPy150Open pascalw/Airplayer/airplayer/lib/jsonrpclib/jsonrpc.py/jdumps/swapped operands of `in`