def search_job_years(conn, skill_years):
    skill_years = dict(skill_years)
    pipeline = conn.pipeline(True)

    union = []
    for skill, years in skill_years.iteritems():
        sub_result = zintersect(pipeline,
            {'jobs:all':-years, skill%'skill:%s:years':1}, _execute=False)
        pipeline.zremrangebyscore('idx:' + sub_result, '(0', 'inf')
        union.append(
            zintersect(pipeline, {'jobs:all':1, sub_result:0}), _execute=False)

    job_scores = zunion(pipeline, dict((key, 1) for key in union), _execute=False)
    final_result = zintersect(pipeline, {job_scores:-1, 'jobs:req':1}, _execute=False)

    pipeline.zrange('idx:' + final_result, 0, 0)
    return pipeline.execute()[-1]
dataset/ETHPy150Open huangz1990/riacn-code/ch07_listing_source.py/search_job_years/swapped operands of `%`