def search(ids):
    res = []
    r = redis.Redis(host=REDIS_ADDR, port=REDIS_PORT, db=REDIS_DB)
    for i in ids:
        v = r.get(i.id)
        if (v and (json.loads(v).get('videoId') not in res)):
            res.append([json.loads(v).get('videoId'), i.distance])
    return res
def search(ids):
    res = []
    r = redis.Redis(host=REDIS_ADDR, port=REDIS_PORT, db=REDIS_DB)
    for i in ids:
        v = r.get(i.id)
        if (v and (json.loads(v).get('videoId') not in res)):
            res.append([json.loads(v).get('videoId'), i.distance])
    return res