Module TryExcept body Import alias identifier handlers ExceptHandler type NameLoad body Import alias ImportFrom alias Import alias ImportFrom alias ImportFrom alias identifier Assign NameStore NameLoad Assign NameStore Call NameLoad ListLoad Str Str Str Str Assign NameStore Call NameLoad ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Str NameLoad Num NameLoad kwarg body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BoolOpOr BoolOpAnd CompareIs NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If NameLoad body Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpMod Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpMod Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpMod Str AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Lambda arguments args NameParam defaults BinOpMod Str TupleLoad AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Lambda arguments args NameParam NameParam defaults BinOpMod Str TupleLoad AttributeLoad NameLoad attr NameLoad NameLoad Assign AttributeStore NameLoad attr Lambda arguments args NameParam NameParam defaults Call AttributeLoad Str attr ListLoad Call NameLoad NameLoad Str Call NameLoad NameLoad Assign AttributeStore NameLoad attr Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr Str Num Assign AttributeStore NameLoad attr BinOpPow Num Num decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num body Assign NameStore Call NameLoad NameLoad Assign NameStore BinOpSub Call NameLoad Str Num Assign NameStore Num For NameStore Call NameLoad NameLoad body If CompareLt NameLoad NameLoad body Assign NameStore BinOpSub Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad If BoolOpOr CompareLt NameLoad Num CompareGt NameLoad Num body Assign NameStore Num orelse Assign NameStore Num AugAssignAdd NameStore BinOpMult NameLoad BinOpPow Num BinOpSub NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str Str Call AttributeLoad NameLoad attr Return ListComp NameLoad comprehension NameStore Call AttributeLoad NameLoad attr CompareNotIn NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad Str attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body For NameStore Call NameLoad Num Call NameLoad NameLoad body Expr Yield SubscriptLoad NameLoad Slice NameLoad Expr Yield NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Num body If NameLoad body Return Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod Str AttributeLoad NameLoad attr For NameStore Call NameLoad Num Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Slice NameLoad BinOpAdd NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore NameLoad If CompareIs NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad BoolOpOr NameLoad Str If BoolOpAnd NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad If CompareEq NameLoad NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad NameLoad Return orelse Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad For TupleStore NameStore NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad body Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore BinOpAdd BinOpMult NameLoad BinOpAdd NameLoad Num NameLoad For NameStore Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Return Call AttributeLoad NameLoad attr NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad BoolOpOr NameLoad Str Assign NameStore BoolOpOr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Str Assign NameStore ListLoad For NameStore Call AttributeLoad NameLoad attr NameLoad body For NameStore Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num Num body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad BoolOpOr NameLoad Num If NameLoad body Assign NameStore BinOpDiv Num NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad BinOpMult NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad BoolOpOr NameLoad Str Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If NameLoad body Assign NameStore Call AttributeLoad Str attr GeneratorExp BinOpMod Str TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad Call AttributeLoad NameLoad attr orelse Assign NameStore Str Assign NameStore Call AttributeLoad Str attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body For NameStore GeneratorExp Call NameLoad NameLoad comprehension NameStore Call NameLoad keyword NameLoad BinOpMult ListLoad Call NameLoad NameLoad NameLoad body If CompareIs SubscriptLoad NameLoad Index Num NameLoad body Delete SubscriptDel NameLoad Slice Call AttributeLoad NameLoad attr NameLoad Expr Yield NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Num Assign NameStore ListLoad If UnaryOpNot NameLoad body Return NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Assign NameStore ListLoad NameLoad For NameStore NameLoad body For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr NameLoad body If UnaryOpNot NameLoad body Continue If NameLoad body For NameStore NameLoad body Assign NameStore Call NameLoad NameLoad If NameLoad body Assign NameStore NameLoad For NameStore NameLoad body If UnaryOpNot Call NameLoad NameLoad body Assign NameStore NameLoad Break If UnaryOpNot NameLoad body Continue Expr Call AttributeLoad NameLoad attr NameLoad AugAssignAdd NameStore Num If BoolOpAnd NameLoad CompareEq NameLoad NameLoad body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Return ListLoad If NameLoad body Assign NameStore BoolOpOr NameLoad Dict Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr For NameStore NameLoad body If CompareNotIn NameLoad NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad If BoolOpAnd CompareEq Call NameLoad NameLoad Num UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call NameLoad AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr If NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num Num keyword NameLoad body Assign NameStore NameLoad For NameStore Call AttributeLoad NameLoad attr NameLoad body If BoolOpAnd NameLoad CompareIn NameLoad NameLoad body AugAssignMult NameStore BinOpDiv Num SubscriptLoad NameLoad Index NameLoad If CompareNotEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Num Num Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad body If UnaryOpNot NameLoad body Assign NameStore ListLoad Expr Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list decorator_list
N/A N/A N/A N/A simplejson json N/A N/A N/A ImportError N/A N/A json itertools izip_longest N/A re redis Redis redis_completion.stop_words STOP_WORDS _STOP_WORDS N/A AGGRESSIVE_STOP_WORDS _STOP_WORDS N/A DEFAULT_STOP_WORDS N/A set N/A a an of the N/A _sentinel N/A object RedisEngine N/A object N/A N/A 
    References
    ----------

    http://antirez.com/post/autocomplete-with-redis.html
    http://stackoverflow.com/questions/1958005/redis-autocomplete/1966188#1966188
    http://patshaughnessy.net/2011/11/29/two-ways-of-using-redis-to-build-a-nosql-autocomplete-search-index
     __init__ N/A N/A self prefix stop_words cache_timeout redis_client N/A ac None 300 None conn_kwargs N/A N/A N/A self prefix prefix N/A N/A self stop_words N/A N/A N/A stop_words None DEFAULT_STOP_WORDS stop_words N/A N/A self cache_timeout cache_timeout N/A N/A self conn_kwargs conn_kwargs N/A redis_client N/A N/A N/A self client redis_client N/A N/A N/A self client N/A N/A self get_client N/A N/A self boost_key N/A %s:b N/A self prefix N/A N/A self data_key N/A %s:d N/A self prefix N/A N/A self title_key N/A %s:t N/A self prefix N/A N/A self search_key N/A N/A N/A k N/A N/A %s:s:%s N/A N/A self prefix k N/A N/A self cache_key N/A N/A N/A pk bk N/A N/A %s:c:%s:%s N/A N/A self prefix pk bk N/A N/A self kcombine N/A N/A N/A _id _type N/A N/A N/A join N/A N/A str _id N/A str _type N/A N/A self ksplit N/A N/A N/A k N/A N/A N/A k split 1 N/A N/A self _offset N/A 27 20 N/A get_client N/A N/A self N/A N/A N/A N/A Redis N/A self conn_kwargs N/A score_key N/A N/A self k max_size N/A 20 N/A N/A k_len N/A len k N/A a N/A N/A ord a 2 N/A score 0 N/A i N/A range max_size N/A N/A N/A i k_len N/A N/A c N/A N/A ord N/A k N/A i a N/A N/A N/A c 2 N/A c 27 N/A N/A c 1 N/A N/A c 1 N/A score N/A c N/A 27 N/A max_size i N/A score N/A clean_phrase N/A N/A self phrase N/A N/A N/A phrase N/A N/A re sub [^a-z0-9_\-\s] N/A N/A phrase lower N/A N/A w N/A w N/A N/A phrase split N/A w N/A self stop_words N/A create_key N/A N/A self phrase N/A N/A N/A N/A N/A join N/A N/A self clean_phrase phrase N/A autocomplete_keys N/A N/A self w N/A N/A N/A i N/A range 1 N/A len w N/A N/A N/A N/A w N/A i N/A N/A w N/A flush N/A N/A self everything batch_size N/A False 1000 N/A N/A everything N/A N/A N/A N/A N/A self client flushdb N/A keys N/A N/A N/A self client keys N/A %s:* N/A self prefix N/A i N/A range 0 N/A len keys batch_size N/A N/A N/A N/A N/A self client delete N/A keys N/A i N/A i batch_size N/A store N/A N/A self obj_id title data obj_type check_exist N/A None None None True N/A N/A N/A title None N/A N/A title obj_id N/A N/A data None N/A N/A data title N/A title_score N/A N/A self score_key N/A N/A self create_key title N/A combined_id N/A N/A self kcombine obj_id N/A obj_type N/A N/A check_exist N/A N/A self exists obj_id obj_type N/A N/A stored_title N/A N/A N/A self client hget N/A self title_key combined_id N/A N/A stored_title title N/A N/A N/A N/A N/A self client hset N/A self data_key combined_id data N/A N/A N/A N/A N/A self remove obj_id obj_type N/A pipe N/A N/A N/A self client pipeline N/A N/A N/A pipe hset N/A self data_key combined_id data N/A N/A N/A pipe hset N/A self title_key combined_id title N/A N/A i word N/A enumerate N/A N/A self clean_phrase title N/A N/A word_score N/A N/A N/A self score_key word N/A self _offset N/A key_score N/A N/A word_score N/A i 1 title_score N/A partial_key N/A N/A self autocomplete_keys word N/A N/A N/A N/A pipe zadd N/A N/A self search_key partial_key combined_id key_score N/A N/A N/A pipe execute N/A store_json N/A N/A self obj_id title data_dict obj_type N/A None N/A N/A N/A N/A self store obj_id title N/A N/A json dumps data_dict obj_type N/A remove N/A N/A self obj_id obj_type N/A None N/A N/A obj_id N/A N/A self kcombine obj_id N/A obj_type N/A title N/A N/A N/A N/A self client hget N/A self title_key obj_id N/A keys N/A N/A word N/A N/A self clean_phrase title N/A N/A partial_key N/A N/A self autocomplete_keys word N/A N/A key N/A N/A self search_key partial_key N/A N/A N/A N/A N/A self client zrange key 1 2 N/A N/A N/A N/A N/A self client delete key N/A N/A N/A N/A N/A self client zrem key obj_id N/A N/A N/A N/A self client hdel N/A self data_key obj_id N/A N/A N/A N/A self client hdel N/A self title_key obj_id N/A N/A N/A N/A self client hdel N/A self boost_key obj_id N/A boost N/A N/A self obj_id multiplier negative N/A 1.1 False N/A N/A current N/A N/A N/A self client hget N/A self boost_key obj_id N/A current_f N/A float N/A current 1.0 N/A negative N/A N/A multiplier N/A 1 multiplier N/A N/A N/A N/A self client hset N/A self boost_key obj_id N/A current_f multiplier N/A exists N/A N/A self obj_id obj_type N/A None N/A N/A obj_id N/A N/A self kcombine obj_id N/A obj_type N/A N/A N/A N/A self client hexists N/A self data_key obj_id N/A get_cache_key N/A N/A self phrases boosts N/A N/A N/A boosts N/A N/A boost_key N/A N/A | join N/A N/A %s:%s N/A k v N/A N/A k v N/A sorted N/A N/A boosts items N/A N/A boost_key N/A phrase_key N/A N/A | join phrases N/A N/A N/A self cache_key phrase_key boost_key N/A _chunked N/A N/A self iterable n N/A N/A N/A group N/A N/A list g N/A g N/A izip_longest fillvalue _sentinel N/A N/A N/A iter iterable n N/A N/A N/A N/A group N/A -1 _sentinel N/A N/A N/A group N/A N/A N/A group index _sentinel N/A N/A group N/A _process_ids N/A N/A self id_list limit filters mappers N/A N/A N/A ct 0 N/A data N/A N/A N/A id_list N/A N/A data N/A N/A limit None N/A N/A chunks N/A N/A self _chunked id_list limit N/A N/A chunks N/A id_list N/A chunk chunks N/A N/A raw_data N/A N/A N/A self client hmget N/A self data_key chunk N/A N/A N/A raw_data N/A N/A N/A mappers N/A N/A m mappers N/A N/A raw_data N/A m raw_data N/A filters N/A N/A passes True N/A f filters N/A N/A N/A N/A f raw_data N/A N/A passes False N/A N/A N/A passes N/A N/A N/A N/A N/A data append raw_data N/A ct 1 N/A N/A limit N/A ct limit N/A N/A data N/A data N/A search N/A N/A self phrase limit filters mappers boosts autoboost N/A None None None None False N/A N/A cleaned N/A N/A self clean_phrase phrase N/A N/A cleaned N/A N/A N/A N/A autoboost N/A N/A boosts N/A boosts N/A N/A stored N/A N/A N/A self client hgetall N/A self boost_key N/A obj_id stored N/A N/A N/A obj_id boosts N/A N/A N/A boosts N/A obj_id N/A float N/A stored N/A obj_id N/A N/A N/A N/A len cleaned 1 N/A boosts N/A N/A new_key N/A N/A self search_key N/A cleaned N/A 0 N/A N/A new_key N/A N/A self get_cache_key cleaned boosts N/A N/A N/A N/A N/A self client exists new_key N/A N/A N/A N/A N/A self client zinterstore new_key N/A map N/A self search_key cleaned N/A N/A N/A N/A self client expire new_key N/A self cache_timeout N/A boosts N/A N/A pipe N/A N/A N/A self client pipeline N/A N/A raw_id score N/A N/A N/A self client zrange new_key 0 -1 withscores True N/A N/A orig_score score N/A part N/A N/A self ksplit raw_id N/A N/A N/A part N/A part boosts N/A N/A score N/A 1 N/A boosts N/A part N/A N/A orig_score score N/A N/A N/A N/A pipe zadd new_key raw_id score N/A N/A N/A pipe execute N/A id_list N/A N/A N/A self client zrange new_key 0 -1 N/A N/A N/A self _process_ids id_list limit filters mappers N/A search_json N/A N/A self phrase limit filters mappers boosts autoboost N/A None None None None False N/A N/A N/A mappers N/A N/A mappers N/A N/A N/A N/A mappers insert 0 N/A json loads N/A N/A N/A self search phrase limit filters mappers boosts autoboost N/A N/A