Module Import alias Import alias Import alias Import alias Import alias Import alias Import alias FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults ListLoad ListLoad NameLoad body If UnaryOpNot NameLoad body If UnaryOpNot SubscriptLoad NameLoad Index Num body Assign SubscriptStore NameLoad Index Num Call AttributeLoad NameLoad attr Str Str NameLoad keyword Str TryExcept body Return Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Num Call NameLoad NameLoad BinOpAdd NameLoad NameLoad handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr name NameStore body If UnaryOpNot Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index Num attr Str body Raise Return Call AttributeLoad NameLoad attr Str NameLoad Call NameLoad NameLoad BinOpAdd NameLoad NameLoad decorator_list Return NameLoad decorator_list Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Str Expr Call AttributeLoad NameLoad attr Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr If UnaryOpNot NameLoad body Return NameLoad Expr Call AttributeLoad NameLoad attr Dict Str Str Str Str Str NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Str Expr Call AttributeLoad NameLoad attr Return NameLoad decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults kwarg body Assign NameStore ListLoad Str NameLoad Str Call AttributeLoad NameLoad attr Str NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return Call NameLoad NameLoad ListLoad BinOpMod Str NameLoad Str NameLoad decorator_list Assign NameStore Call NameLoad Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num Num body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore BinOpAdd Str NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr NameLoad While CompareLt Call AttributeLoad NameLoad attr NameLoad body If Call AttributeLoad NameLoad attr NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad orelse If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Num Return NameLoad decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num Num body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore BinOpAdd Str NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr NameLoad While BoolOpAnd CompareLt Call AttributeLoad NameLoad attr NameLoad UnaryOpNot NameLoad body Assign NameStore CompareEq Call NameLoad NameLoad ListLoad NameLoad ListLoad NameLoad NameLoad Str Expr Call AttributeLoad NameLoad attr BinOpMult Num UnaryOpNot NameLoad Return BoolOpAnd NameLoad NameLoad decorator_list Assign NameStore Call NameLoad Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd Str NameLoad While NameLoad body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad If CompareEq Call AttributeLoad NameLoad attr NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Return NameLoad Expr Call AttributeLoad NameLoad attr Break handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr body Pass Return NameLoad decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore BinOpAdd Str NameLoad Return Call NameLoad NameLoad ListLoad NameLoad ListLoad NameLoad decorator_list Assign NameStore Call NameLoad Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str BinOpSub NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareLt SubscriptLoad Call AttributeLoad NameLoad attr Index Num NameLoad body Return NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return NameLoad decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num body Assign NameStore Call AttributeLoad NameLoad attr Return Call NameLoad NameLoad ListLoad NameLoad ListLoad BinOpSub NameLoad NameLoad NameLoad NameLoad Call NameLoad Call AttributeLoad NameLoad attr decorator_list Assign NameStore Call NameLoad Str FunctionDef arguments args NameParam NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Return CompareNotEq Call NameLoad NameLoad ListLoad NameLoad ListLoad NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list Assign NameStore Call NameLoad Str Assign NameStore Str FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Slice Num Assign NameStore SubscriptLoad NameLoad Index BinOpSub BoolOpOr NameLoad Num Num Return TupleLoad BinOpAdd BinOpAdd SubscriptLoad NameLoad Slice Num NameLoad Str BinOpAdd NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr AugAssignAdd NameStore NameLoad AugAssignAdd NameStore NameLoad Assign NameStore BinOpAdd Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Num NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad While Num body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call NameLoad BinOpAdd NameLoad Num BinOpSub NameLoad Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Index Num Break handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr body Continue Return ListComp NameLoad comprehension NameStore NameLoad CompareNotIn Str NameLoad decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Assign TupleStore NameStore NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad ListLoad BinOpAdd Str NameLoad ListLoad BinOpAdd NameLoad NameLoad BinOpAdd NameLoad NameLoad Return ListComp NameLoad comprehension NameStore NameLoad CompareNotIn Str NameLoad decorator_list Assign NameStore Call NameLoad Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore BinOpMod Str NameLoad Assign NameStore BinOpMod Str NameLoad Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore BinOpMod Str NameLoad Assign NameStore Call NameLoad NameLoad Str If UnaryOpNot NameLoad body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad TryFinally body Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr If BoolOpOr CompareIs NameLoad NameLoad CompareGt NameLoad NameLoad body Return NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str Call NameLoad UnaryOpUSub NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Return NameLoad finalbody Expr Call NameLoad NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore BinOpMod Str NameLoad Assign NameStore BinOpMod Str NameLoad Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad Assign NameStore BinOpMod Str NameLoad Return Call NameLoad NameLoad ListLoad Str NameLoad NameLoad NameLoad ListLoad NameLoad NameLoad decorator_list Assign NameStore Call NameLoad Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore BinOpMod Str NameLoad Assign NameStore BinOpMod Str TupleLoad NameLoad NameLoad Return Call NameLoad NameLoad ListLoad NameLoad Str ListLoad NameLoad NameLoad NameLoad decorator_list Assign NameStore Call NameLoad Str FunctionDef arguments args NameParam NameParam defaults vararg kwarg body Assign NameStore Call NameLoad NameLoad Assign NameStore Num While NameLoad body Assign NameStore Call NameLoad NameLoad ListLoad BinOpAdd NameLoad Str BinOpAdd NameLoad Str BinOpAdd NameLoad Str BinOpAdd ListLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Slice Num AugAssignAdd NameStore NameLoad Delete SubscriptDel NameLoad Slice NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults vararg body Return Call NameLoad NameLoad NameLoad keyword Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults vararg body Return Call NameLoad NameLoad NameLoad keyword Str NameLoad decorator_list Assign NameStore Call NameLoad Str FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad NameLoad ListLoad BinOpAdd NameLoad Str BinOpAdd NameLoad Str BinOpAdd NameLoad Str decorator_list Assign NameStore Call NameLoad Str FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad NameLoad ListLoad BinOpAdd NameLoad Str BinOpAdd NameLoad Str BinOpAdd NameLoad Str ListLoad Str decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call NameLoad NameLoad ListLoad BinOpAdd NameLoad Str BinOpAdd NameLoad Str BinOpAdd NameLoad Str ListLoad Str decorator_list Assign NameStore Call NameLoad Str Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BoolOpOr Call NameLoad NameLoad Num BinOpPow Num Num Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr NameLoad While CompareLt Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad If CompareNotIn NameLoad TupleLoad NameLoad NameLoad body Return NameLoad Assign NameStore BoolOpOr Call AttributeLoad NameLoad attr BinOpAdd NameLoad NameLoad Str Expr Call NameLoad NameLoad ListLoad BinOpAdd NameLoad Str BinOpAdd NameLoad NameLoad ListLoad NameLoad NameLoad NameLoad keyword NameLoad Expr Call Call NameLoad NameLoad NameLoad BinOpAdd BinOpAdd NameLoad Str NameLoad Num Assign NameStore SubscriptLoad BoolOpOr SubscriptLoad Call AttributeLoad NameLoad attr Index Num ListLoad NameLoad Index Num If CompareNotIn NameLoad TupleLoad NameLoad NameLoad body Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num body Return Call NameLoad NameLoad NameLoad NameLoad NameLoad Str Str Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num body Return Call NameLoad NameLoad NameLoad NameLoad NameLoad Str Str Str decorator_list Assign NameStore Call NameLoad Str ClassDef bases AttributeLoad NameLoad attr body FunctionDef arguments args NameParam defaults body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr keyword Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call Call NameLoad Str AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Num Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Num Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str Num Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Num Num Expr Call NameLoad AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Num Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad For NameStore Call NameLoad Num body Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Num keyword Num Expr Call AttributeLoad NameLoad attr CompareNotIn NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Num keyword Num Expr Call AttributeLoad NameLoad attr Num Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str Num keyword Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Num Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Num Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body For NameStore Call AttributeLoad Str attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad Num Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Str ListLoad Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Str ListLoad Str Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Str ListLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Num Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Num Num Num Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Num Num Num Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Num Str Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Num Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Num Str Num decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Call NameLoad Num Num Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Call NameLoad Num Num Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Call NameLoad Num Num Num Num Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Str For NameStore Call NameLoad Num body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore ListLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body For NameStore Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword TupleLoad AttributeLoad NameLoad attr NameLoad Str Num Num Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Call NameLoad Num Num Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Str Call NameLoad Num Num Num Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad ListLoad Str Str Str Str NameLoad Str Str Str Str NameLoad decorator_list decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr
N/A N/A bisect N/A math N/A threading N/A time N/A unittest N/A uuid N/A redis script_load N/A N/A script N/A N/A N/A sha N/A None call N/A N/A conn keys args force_eval N/A N/A N/A False N/A N/A N/A force_eval N/A N/A N/A N/A sha N/A 0 N/A N/A N/A sha N/A 0 N/A N/A conn execute_command SCRIPT LOAD script parse LOAD N/A N/A N/A N/A N/A conn execute_command EVALSHA N/A sha N/A 0 N/A len keys N/A keys args N/A N/A N/A N/A N/A redis exceptions ResponseError N/A msg N/A N/A N/A N/A N/A N/A N/A msg args N/A 0 startswith NOSCRIPT N/A N/A N/A N/A N/A conn execute_command EVAL script N/A len keys N/A keys args N/A N/A call N/A N/A 
# <start id="show-script-load"/>
>>> ret_1 = script_load("return 1")     #A
>>> ret_1(conn)                         #B
1L                                      #C
# <end id="show-script-load"/>
#A Most uses will load the script and store a reference to the returned function
#B You can then call the function by passing the connection object and any desired arguments
#C Results will be returned and converted into appropriate Python types, when possible
#END
 create_status N/A N/A conn uid message N/A data N/A N/A pipeline N/A N/A conn pipeline True N/A N/A N/A pipeline hget N/A user:%s uid login N/A N/A N/A pipeline incr status:id: N/A N/A login id N/A N/A pipeline execute N/A N/A login N/A N/A None N/A N/A N/A data update N/A message posted id uid login message N/A N/A time time id uid login N/A N/A N/A pipeline hmset N/A status:%s id data N/A N/A N/A pipeline hincrby N/A user:%s uid posts N/A N/A N/A pipeline execute N/A id N/A N/A _create_status create_status create_status N/A N/A conn uid message N/A data N/A N/A args N/A message message posted N/A N/A time time uid uid N/A N/A key value N/A N/A data iteritems N/A N/A N/A N/A args append key N/A N/A N/A args append value N/A N/A create_status_lua conn N/A N/A user:%s uid status:id: args N/A N/A create_status_lua N/A script_load 
local login = redis.call('hget', KEYS[1], 'login')      --A
if not login then                                       --B
    return false                                        --B
end
local id = redis.call('incr', KEYS[2])                  --C
local key = string.format('status:%s', id)              --D

redis.call('hmset', key,                                --E
    'login', login,                                     --E
    'id', id,                                           --E
    unpack(ARGV))                                       --E
redis.call('hincrby', KEYS[1], 'posts', 1)              --F

return id                                               --G
 acquire_lock_with_timeout N/A N/A conn lockname acquire_timeout lock_timeout N/A 10 10 N/A N/A identifier N/A str N/A N/A uuid uuid4 N/A lockname N/A lock: lockname N/A lock_timeout N/A int N/A N/A math ceil lock_timeout N/A end N/A N/A N/A time time acquire_timeout N/A N/A N/A N/A time time end N/A N/A N/A N/A conn setnx lockname identifier N/A N/A N/A N/A conn expire lockname lock_timeout N/A identifier N/A N/A N/A N/A N/A conn ttl lockname N/A N/A N/A N/A conn expire lockname lock_timeout N/A N/A N/A time sleep 0.001 N/A False N/A N/A _acquire_lock_with_timeout acquire_lock_with_timeout acquire_lock_with_timeout N/A N/A conn lockname acquire_timeout lock_timeout N/A 10 10 N/A N/A identifier N/A str N/A N/A uuid uuid4 N/A lockname N/A lock: lockname N/A lock_timeout N/A int N/A N/A math ceil lock_timeout N/A acquired False N/A end N/A N/A N/A time time acquire_timeout N/A N/A N/A N/A N/A time time end N/A acquired N/A N/A acquired N/A N/A acquire_lock_with_timeout_lua conn N/A lockname N/A lock_timeout identifier OK N/A N/A N/A time sleep N/A 0.001 N/A acquired N/A N/A acquired identifier N/A N/A acquire_lock_with_timeout_lua N/A script_load 
if redis.call('exists', KEYS[1]) == 0 then              --B
    return redis.call('setex', KEYS[1], unpack(ARGV))   --C
end
 release_lock N/A N/A conn lockname identifier N/A N/A N/A pipe N/A N/A conn pipeline True N/A lockname N/A lock: lockname N/A True N/A N/A N/A N/A N/A N/A pipe watch lockname N/A N/A N/A N/A pipe get lockname identifier N/A N/A N/A N/A pipe multi N/A N/A N/A pipe delete lockname N/A N/A N/A pipe execute N/A True N/A N/A N/A pipe unwatch N/A N/A N/A N/A N/A N/A redis exceptions WatchError N/A N/A N/A False N/A N/A _release_lock release_lock release_lock N/A N/A conn lockname identifier N/A N/A N/A lockname N/A lock: lockname N/A N/A release_lock_lua conn N/A lockname N/A identifier N/A N/A release_lock_lua N/A script_load 
if redis.call('get', KEYS[1]) == ARGV[1] then               --B
    return redis.call('del', KEYS[1]) or true               --C
end
 acquire_semaphore N/A N/A conn semname limit timeout N/A 10 N/A N/A identifier N/A str N/A N/A uuid uuid4 N/A now N/A N/A time time N/A pipeline N/A N/A conn pipeline True N/A N/A N/A pipeline zremrangebyscore semname -inf N/A now timeout N/A N/A N/A pipeline zadd semname identifier now N/A N/A N/A pipeline zrank semname identifier N/A N/A N/A N/A N/A pipeline execute N/A -1 limit N/A N/A identifier N/A N/A N/A conn zrem semname identifier N/A None N/A N/A _acquire_semaphore acquire_semaphore acquire_semaphore N/A N/A conn semname limit timeout N/A 10 N/A N/A now N/A N/A time time N/A N/A acquire_semaphore_lua conn N/A semname N/A N/A now timeout limit now N/A str N/A N/A uuid uuid4 N/A N/A acquire_semaphore_lua N/A script_load 
redis.call('zremrangebyscore', KEYS[1], '-inf', ARGV[1])        --C

if redis.call('zcard', KEYS[1]) < tonumber(ARGV[2]) then        --D
    redis.call('zadd', KEYS[1], ARGV[3], ARGV[4])               --E
    return ARGV[4]
end
 release_semaphore N/A N/A conn semname identifier N/A N/A N/A N/A N/A conn zrem semname identifier N/A refresh_semaphore N/A N/A conn semname identifier N/A N/A N/A N/A N/A refresh_semaphore_lua conn N/A semname N/A identifier N/A N/A time time None N/A N/A refresh_semaphore_lua N/A script_load 
if redis.call('zscore', KEYS[1], ARGV[1]) then                   --B
    return redis.call('zadd', KEYS[1], ARGV[2], ARGV[1]) or true --B
end
 N/A valid_characters `abcdefghijklmnopqrstuvwxyz{ find_prefix_range N/A N/A prefix N/A N/A N/A posn N/A N/A bisect bisect_left valid_characters N/A prefix N/A -1 N/A suffix N/A valid_characters N/A N/A N/A posn 1 1 N/A N/A N/A N/A N/A prefix N/A -1 suffix { N/A prefix { N/A autocomplete_on_prefix N/A N/A conn guild prefix N/A N/A N/A N/A start end N/A find_prefix_range prefix N/A identifier N/A str N/A N/A uuid uuid4 N/A start identifier N/A end identifier N/A zset_name N/A members: guild N/A N/A N/A conn zadd zset_name start 0 end 0 N/A pipeline N/A N/A conn pipeline True N/A 1 N/A N/A N/A N/A N/A N/A pipeline watch zset_name N/A sindex N/A N/A pipeline zrank zset_name start N/A eindex N/A N/A pipeline zrank zset_name end N/A erange N/A min N/A sindex 9 N/A eindex 2 N/A N/A N/A pipeline multi N/A N/A N/A pipeline zrem zset_name start end N/A N/A N/A pipeline zrange zset_name sindex erange N/A items N/A N/A N/A pipeline execute N/A -1 N/A N/A N/A N/A N/A N/A redis exceptions WatchError N/A N/A N/A N/A item N/A item items N/A { item N/A N/A _autocomplete_on_prefix autocomplete_on_prefix autocomplete_on_prefix N/A N/A conn guild prefix N/A N/A N/A N/A start end N/A find_prefix_range prefix N/A identifier N/A str N/A N/A uuid uuid4 N/A items N/A autocomplete_on_prefix_lua conn N/A N/A members: guild N/A N/A start identifier N/A end identifier N/A N/A item N/A item items N/A { item N/A N/A autocomplete_on_prefix_lua N/A script_load 
redis.call('zadd', KEYS[1], 0, ARGV[1], 0, ARGV[2])             --D
local sindex = redis.call('zrank', KEYS[1], ARGV[1])            --E
local eindex = redis.call('zrank', KEYS[1], ARGV[2])            --E
eindex = math.min(sindex + 9, eindex - 2)                       --F

redis.call('zrem', KEYS[1], unpack(ARGV))                       --G
return redis.call('zrange', KEYS[1], sindex, eindex)            --H
 purchase_item_with_lock N/A N/A conn buyerid itemid sellerid N/A N/A N/A buyer N/A users:%s buyerid N/A seller N/A users:%s sellerid N/A item N/A %s.%s N/A itemid sellerid N/A inventory N/A inventory:%s buyerid N/A locked N/A acquire_lock conn market: N/A N/A locked N/A N/A False N/A pipe N/A N/A conn pipeline True N/A N/A N/A N/A N/A pipe zscore market: item N/A N/A N/A pipe hget buyer funds N/A N/A price funds N/A N/A pipe execute N/A N/A N/A price None N/A price funds N/A N/A None N/A N/A N/A pipe hincrby seller funds N/A int price N/A N/A N/A pipe hincrby buyer funds N/A int N/A price N/A N/A N/A pipe sadd inventory itemid N/A N/A N/A pipe zrem market: item N/A N/A N/A pipe execute N/A True N/A N/A N/A release_lock conn market: locked N/A purchase_item N/A N/A conn buyerid itemid sellerid N/A N/A N/A buyer N/A users:%s buyerid N/A seller N/A users:%s sellerid N/A item N/A %s.%s N/A itemid sellerid N/A inventory N/A inventory:%s buyerid N/A N/A purchase_item_lua conn N/A market: buyer seller inventory N/A item itemid N/A N/A purchase_item_lua N/A script_load 
local price = tonumber(redis.call('zscore', KEYS[1], ARGV[1]))  --B
local funds = tonumber(redis.call('hget', KEYS[2], 'funds'))    --B

if price and funds and funds >= price then                      --C
    redis.call('hincrby', KEYS[3], 'funds', price)              --C
    redis.call('hincrby', KEYS[2], 'funds', -price)             --C
    redis.call('sadd', KEYS[4], ARGV[2])                        --C
    redis.call('zrem', KEYS[1], ARGV[1])                        --C
    return true                                                 --D
end
 list_item N/A N/A conn itemid sellerid price N/A N/A N/A inv N/A inventory:%s sellerid N/A item N/A %s.%s N/A itemid sellerid N/A N/A list_item_lua conn N/A inv market: N/A itemid item price N/A N/A list_item_lua N/A script_load 
if redis.call('sismember', KEYS[1], ARGV[1]) ~= 0 then
    redis.call('zadd', KEYS[2], ARGV[2], ARGV[3])
    redis.call('srem', KEYS[1], ARGV[1])
    return true
end
 sharded_push_helper N/A N/A conn key N/A items kwargs N/A N/A items N/A list items N/A total 0 N/A items N/A N/A pushed N/A sharded_push_lua conn N/A N/A key : N/A key :first N/A key :last N/A N/A N/A kwargs N/A cmd N/A items N/A 64 N/A total pushed N/A N/A items N/A pushed N/A total N/A sharded_lpush N/A N/A conn key N/A items N/A N/A N/A sharded_push_helper conn key cmd lpush items N/A sharded_rpush N/A N/A conn key N/A items N/A N/A N/A sharded_push_helper conn key cmd rpush items N/A N/A sharded_push_lua N/A script_load 
local max = tonumber(redis.call(                            --I
    'config', 'get', 'list-max-ziplist-entries')[2])        --I
if #ARGV < 2 or max < 2 then return 0 end                   --J

local skey = ARGV[1] == 'lpush' and KEYS[2] or KEYS[3]      --K
local shard = redis.call('get', skey) or '0'                --K

while 1 do
    local current = tonumber(redis.call('llen', KEYS[1]..shard))    --L
    local topush = math.min(#ARGV - 1, max - current - 1)           --M
    if topush > 0 then                                              --N
        redis.call(ARGV[1], KEYS[1]..shard, unpack(ARGV, 2, topush+1))--N
        return topush                                                 --N
    end
    shard = redis.call(ARGV[1] == 'lpush' and 'decr' or 'incr', skey) --O
end
 sharded_llen N/A N/A conn key N/A N/A N/A N/A sharded_llen_lua conn N/A N/A key : N/A key :first N/A key :last N/A N/A sharded_llen_lua N/A script_load 
local shardsize = tonumber(redis.call(
    'config', 'get', 'list-max-ziplist-entries')[2])

local first = tonumber(redis.call('get', KEYS[2]) or '0')
local last = tonumber(redis.call('get', KEYS[3]) or '0')

local total = 0
total = total + tonumber(redis.call('llen', KEYS[1]..first))
if first ~= last then
    total = total + (last - first - 1) * (shardsize-1)
    total = total + tonumber(redis.call('llen', KEYS[1]..last))
end

return total
 sharded_lpop N/A N/A conn key N/A N/A N/A N/A sharded_list_pop_lua conn N/A N/A key : N/A key :first N/A key :last N/A lpop N/A sharded_rpop N/A N/A conn key N/A N/A N/A N/A sharded_list_pop_lua conn N/A N/A key : N/A key :first N/A key :last N/A rpop N/A N/A sharded_list_pop_lua N/A script_load 
local skey = ARGV[1] == 'lpop' and KEYS[2] or KEYS[3]           --A
local okey = ARGV[1] ~= 'lpop' and KEYS[2] or KEYS[3]           --B
local shard = redis.call('get', skey) or '0'                    --C

local ret = redis.call(ARGV[1], KEYS[1]..shard)                 --D
if not ret or redis.call('llen', KEYS[1]..shard) == '0' then    --E
    local oshard = redis.call('get', okey) or '0'               --F

    if shard == oshard then                                     --G
        return ret                                              --G
    end

    local cmd = ARGV[1] == 'lpop' and 'incr' or 'decr'          --H
    shard = redis.call(cmd, skey)                               --I
    if not ret then
        ret = redis.call(ARGV[1], KEYS[1]..shard)               --J
    end
end
return ret
 N/A DUMMY N/A str N/A N/A uuid uuid4 sharded_bpop_helper N/A N/A conn key timeout pop bpop endp push N/A N/A N/A pipe N/A N/A conn pipeline False N/A timeout N/A N/A max timeout 0 N/A 2 64 N/A end N/A N/A N/A time time timeout N/A N/A N/A N/A time time end N/A N/A result N/A pop conn key N/A N/A result N/A None DUMMY N/A N/A result N/A shard N/A N/A N/A conn get N/A key endp 0 N/A N/A sharded_bpop_helper_lua pipe N/A N/A key : N/A key endp N/A shard push DUMMY force_eval True N/A N/A N/A getattr pipe bpop N/A N/A key : shard 1 N/A result N/A N/A N/A N/A N/A pipe execute N/A -1 N/A None N/A -1 N/A N/A result N/A None DUMMY N/A N/A result N/A sharded_blpop N/A N/A conn key timeout N/A 0 N/A N/A N/A sharded_bpop_helper conn key timeout sharded_lpop blpop :first lpush N/A sharded_brpop N/A N/A conn key timeout N/A 0 N/A N/A N/A sharded_bpop_helper conn key timeout sharded_rpop brpop :last rpush N/A N/A sharded_bpop_helper_lua N/A script_load 
local shard = redis.call('get', KEYS[2]) or '0'                     --J
if shard ~= ARGV[1] then                                            --K
    redis.call(ARGV[2], KEYS[1]..ARGV[1], ARGV[3])                  --K
end
 TestCh11 N/A N/A unittest TestCase N/A setUp N/A N/A self N/A N/A N/A N/A self conn N/A N/A redis Redis db 15 N/A N/A N/A N/A self conn flushdb N/A tearDown N/A N/A self N/A N/A N/A N/A N/A N/A self conn flushdb N/A test_load_script N/A N/A self N/A N/A N/A N/A N/A self assertEquals N/A N/A script_load return 1 N/A self conn 1 N/A test_create_status N/A N/A self N/A N/A N/A N/A N/A N/A self conn hset user:1 login test N/A sid N/A _create_status N/A self conn 1 hello N/A sid2 N/A create_status N/A self conn 1 hello N/A N/A N/A self assertEquals N/A N/A N/A self conn hget user:1 posts 2 N/A data N/A N/A N/A self conn hgetall N/A status:%s sid N/A data2 N/A N/A N/A self conn hgetall N/A status:%s sid2 N/A N/A N/A data pop posted N/A N/A N/A data pop id N/A N/A N/A data2 pop posted N/A N/A N/A data2 pop id N/A N/A N/A self assertEquals data data2 N/A test_locking N/A N/A self N/A N/A N/A identifier N/A acquire_lock_with_timeout N/A self conn test 1 5 N/A N/A N/A self assertTrue identifier N/A N/A N/A self assertFalse N/A acquire_lock_with_timeout N/A self conn test 1 5 N/A N/A release_lock N/A self conn test identifier N/A N/A N/A self assertTrue N/A acquire_lock_with_timeout N/A self conn test 1 5 N/A test_semaphore N/A N/A self N/A N/A N/A ids N/A N/A i N/A xrange 5 N/A N/A N/A N/A ids append N/A acquire_semaphore N/A self conn test 5 timeout 1 N/A N/A N/A self assertTrue N/A None ids N/A N/A N/A self assertFalse N/A acquire_semaphore N/A self conn test 5 timeout 1 N/A N/A N/A time sleep 0.01 N/A id N/A acquire_semaphore N/A self conn test 5 timeout 0 N/A N/A N/A self assertTrue id N/A N/A N/A self assertFalse N/A refresh_semaphore N/A self conn test N/A ids N/A -1 N/A N/A N/A self assertFalse N/A release_semaphore N/A self conn test N/A ids N/A -1 N/A N/A N/A self assertTrue N/A refresh_semaphore N/A self conn test id N/A N/A N/A self assertTrue N/A release_semaphore N/A self conn test id N/A N/A N/A self assertFalse N/A release_semaphore N/A self conn test id N/A test_autocomplet_on_prefix N/A N/A self N/A N/A N/A word N/A N/A these are some words that we will be autocompleting on split N/A N/A N/A N/A N/A self conn zadd members:test word 0 N/A N/A N/A self assertEquals N/A autocomplete_on_prefix N/A self conn test th N/A that these N/A N/A N/A self assertEquals N/A autocomplete_on_prefix N/A self conn test w N/A we will words N/A N/A N/A self assertEquals N/A autocomplete_on_prefix N/A self conn test autocompleting N/A autocompleting N/A test_marketplace N/A N/A self N/A N/A N/A N/A N/A N/A self conn sadd inventory:1 1 N/A N/A N/A N/A self conn hset users:2 funds 5 N/A N/A N/A self assertFalse N/A list_item N/A self conn 2 1 10 N/A N/A N/A self assertTrue N/A list_item N/A self conn 1 1 10 N/A N/A N/A self assertFalse N/A purchase_item N/A self conn 2 1 1 N/A N/A N/A N/A self conn zadd market: 1.1 4 N/A N/A N/A self assertTrue N/A purchase_item N/A self conn 2 1 1 N/A test_sharded_list N/A N/A self N/A N/A N/A N/A N/A self assertEquals N/A sharded_lpush N/A self conn lst N/A range 100 100 N/A N/A N/A self assertEquals N/A sharded_llen N/A self conn lst 100 N/A N/A N/A self assertEquals N/A sharded_lpush N/A self conn lst2 N/A range 1000 1000 N/A N/A N/A self assertEquals N/A sharded_llen N/A self conn lst2 1000 N/A N/A N/A self assertEquals N/A sharded_rpush N/A self conn lst2 N/A range -1 -1001 -1 1000 N/A N/A N/A self assertEquals N/A sharded_llen N/A self conn lst2 2000 N/A N/A N/A self assertEquals N/A sharded_lpop N/A self conn lst2 999 N/A N/A N/A self assertEquals N/A sharded_rpop N/A self conn lst2 -1000 N/A i N/A xrange 999 N/A N/A r N/A sharded_lpop N/A self conn lst2 N/A N/A N/A self assertEquals r 0 N/A results N/A pop_some N/A N/A conn fcn lst count timeout N/A N/A N/A i N/A xrange count N/A N/A N/A N/A results append N/A sharded_blpop conn lst timeout N/A N/A t N/A N/A threading Thread target pop_some args N/A N/A self conn sharded_blpop lst3 10 1 N/A N/A N/A t setDaemon 1 N/A N/A N/A t start N/A N/A N/A self assertEquals N/A sharded_rpush N/A self conn lst3 N/A range 4 4 N/A N/A N/A time sleep 2 N/A N/A N/A self assertEquals N/A sharded_rpush N/A self conn lst3 N/A range 4 8 4 N/A N/A N/A time sleep 2 N/A N/A N/A self assertEquals results N/A 0 1 2 3 None 4 5 6 7 None N/A N/A N/A N/A __name__ __main__ N/A N/A N/A N/A unittest main