| 
														
															@@ -139,7 +139,7 @@ def positon_duplicate(pos1_vids, pos2_vids, videos): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 def video_recommend(request_id, mid, uid, size, top_K, flow_pool_P, app_type, algo_type, client_info, 
														 | 
														
														 | 
														
															 def video_recommend(request_id, mid, uid, size, top_K, flow_pool_P, app_type, algo_type, client_info, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     expire_time=24*3600, ab_code=config_.AB_CODE['initial'], rule_key='', data_key='', 
														 | 
														
														 | 
														
															                     expire_time=24*3600, ab_code=config_.AB_CODE['initial'], rule_key='', data_key='', 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     no_op_flag=False, old_video_index=-1, video_id=None, params=None, rule_key_30day=None, 
														 | 
														
														 | 
														
															                     no_op_flag=False, old_video_index=-1, video_id=None, params=None, rule_key_30day=None, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    shield_config=None): 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    shield_config=None, level_weight=None): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     """ 
														 | 
														
														 | 
														
															     """ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     首页线上推荐逻辑 
														 | 
														
														 | 
														
															     首页线上推荐逻辑 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     :param request_id: request_id 
														 | 
														
														 | 
														
															     :param request_id: request_id 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -181,7 +181,8 @@ def video_recommend(request_id, mid, uid, size, top_K, flow_pool_P, app_type, al 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     pool_recall = PoolRecall(request_id=request_id, 
														 | 
														
														 | 
														
															     pool_recall = PoolRecall(request_id=request_id, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                              app_type=app_type, mid=mid, uid=uid, ab_code=ab_code, 
														 | 
														
														 | 
														
															                              app_type=app_type, mid=mid, uid=uid, ab_code=ab_code, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                              client_info=client_info, rule_key=rule_key, data_key=data_key, no_op_flag=no_op_flag, 
														 | 
														
														 | 
														
															                              client_info=client_info, rule_key=rule_key, data_key=data_key, no_op_flag=no_op_flag, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                             params=params, rule_key_30day=rule_key_30day, shield_config=shield_config, video_id= video_id) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                             params=params, rule_key_30day=rule_key_30day, shield_config=shield_config, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                             video_id= video_id, level_weight=level_weight) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     # _, last_rov_recall_key, _ = pool_recall.get_video_last_idx() 
														 | 
														
														 | 
														
															     # _, last_rov_recall_key, _ = pool_recall.get_video_last_idx() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     # # 小时级实验 
														 | 
														
														 | 
														
															     # # 小时级实验 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     # if ab_code in [code for _, code in config_.AB_CODE['rank_by_h'].items()]: 
														 | 
														
														 | 
														
															     # if ab_code in [code for _, code in config_.AB_CODE['rank_by_h'].items()]: 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -411,7 +412,7 @@ def video_recommend(request_id, mid, uid, size, top_K, flow_pool_P, app_type, al 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 def video_old_recommend(request_id, mid, uid, size, top_K, flow_pool_P, app_type, algo_type, client_info, 
														 | 
														
														 | 
														
															 def video_old_recommend(request_id, mid, uid, size, top_K, flow_pool_P, app_type, algo_type, client_info, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     expire_time=24*3600, ab_code=config_.AB_CODE['initial'], rule_key='', data_key='', 
														 | 
														
														 | 
														
															                     expire_time=24*3600, ab_code=config_.AB_CODE['initial'], rule_key='', data_key='', 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                     no_op_flag=False, old_video_index=-1, video_id=None, params=None, rule_key_30day=None, 
														 | 
														
														 | 
														
															                     no_op_flag=False, old_video_index=-1, video_id=None, params=None, rule_key_30day=None, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                    shield_config=None, env_dict = None): 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                    shield_config=None, env_dict=None, level_weight=None): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     """ 
														 | 
														
														 | 
														
															     """ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     首页线上推荐逻辑 
														 | 
														
														 | 
														
															     首页线上推荐逻辑 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     :param request_id: request_id 
														 | 
														
														 | 
														
															     :param request_id: request_id 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -439,7 +440,8 @@ def video_old_recommend(request_id, mid, uid, size, top_K, flow_pool_P, app_type 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     pool_recall = PoolRecall(request_id=request_id, 
														 | 
														
														 | 
														
															     pool_recall = PoolRecall(request_id=request_id, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                              app_type=app_type, mid=mid, uid=uid, ab_code=ab_code, 
														 | 
														
														 | 
														
															                              app_type=app_type, mid=mid, uid=uid, ab_code=ab_code, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                              client_info=client_info, rule_key=rule_key, data_key=data_key, no_op_flag=no_op_flag, 
														 | 
														
														 | 
														
															                              client_info=client_info, rule_key=rule_key, data_key=data_key, no_op_flag=no_op_flag, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                             params=params, rule_key_30day=rule_key_30day, shield_config=shield_config, video_id= video_id) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                             params=params, rule_key_30day=rule_key_30day, shield_config=shield_config, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                             video_id=video_id, level_weight=level_weight) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     exp_config = pool_recall.get_sort_ab_codel_config() 
														 | 
														
														 | 
														
															     exp_config = pool_recall.get_sort_ab_codel_config() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     # 60054 全量: simrecall+融合排序 
														 | 
														
														 | 
														
															     # 60054 全量: simrecall+融合排序 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -910,7 +912,7 @@ def ab_test_op(rank_result, ab_code_list, app_type, mid, uid, **kwargs): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     return rank_result 
														 | 
														
														 | 
														
															     return rank_result 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-def update_redis_data(result, app_type, mid, top_K, expire_time=24*3600): 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+def update_redis_data(result, app_type, mid, top_K, expire_time=24*3600, level_weight=None): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     """ 
														 | 
														
														 | 
														
															     """ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     根据最终的排序结果更新相关redis数据 
														 | 
														
														 | 
														
															     根据最终的排序结果更新相关redis数据 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     :param result: 排序结果 
														 | 
														
														 | 
														
															     :param result: 排序结果 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1010,7 +1012,7 @@ def update_redis_data(result, app_type, mid, top_K, expire_time=24*3600): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             if flow_recall_video: 
														 | 
														
														 | 
														
															             if flow_recall_video: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 # update_local_distribute_count(flow_recall_video) 
														 | 
														
														 | 
														
															                 # update_local_distribute_count(flow_recall_video) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 # update_local_distribute_count_new(flow_recall_video) 
														 | 
														
														 | 
														
															                 # update_local_distribute_count_new(flow_recall_video) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                update_local_distribute_count_new_with_level(flow_recall_video) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                update_local_distribute_count_new_with_level(flow_recall_video, level_weight) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                 # log_.info('update local distribute count success!') 
														 | 
														
														 | 
														
															                 # log_.info('update local distribute count success!') 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															         # 限流视频分发数记录 
														 | 
														
														 | 
														
															         # 限流视频分发数记录 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1203,7 +1205,7 @@ def update_local_distribute_count_new(videos): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         log_.error(traceback.format_exc()) 
														 | 
														
														 | 
														
															         log_.error(traceback.format_exc()) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-def update_local_distribute_count_new_with_level(videos): 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+def update_local_distribute_count_new_with_level(videos, level_weight): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     """ 
														 | 
														
														 | 
														
															     """ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     更新本地分发数 
														 | 
														
														 | 
														
															     更新本地分发数 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     :param videos: 视频列表 type-list [{'videoId':'', 'flowPool':'', 'distributeCount': '', 
														 | 
														
														 | 
														
															     :param videos: 视频列表 type-list [{'videoId':'', 'flowPool':'', 'distributeCount': '', 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1212,8 +1214,12 @@ def update_local_distribute_count_new_with_level(videos): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     """ 
														 | 
														
														 | 
														
															     """ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     try: 
														 | 
														
														 | 
														
															     try: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         redis_helper = RedisHelper() 
														 | 
														
														 | 
														
															         redis_helper = RedisHelper() 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        level_weight = redis_helper.get_data_from_redis(key_name=config_.FLOWPOOL_LEVEL_WEIGHT_KEY_NAME) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-        level_list = [level for level in json.loads(level_weight)] 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        # level_weight = redis_helper.get_data_from_redis(key_name=config_.FLOWPOOL_LEVEL_WEIGHT_KEY_NAME) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        # level_list = [level for level in json.loads(level_weight)] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        if level_weight is None: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+            level_weight = {'1': 1, '2': 1, '3': 1, '4': 1, '5': 1, '6': 1} 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+        level_list = [level for level in level_weight] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         for item in videos: 
														 | 
														
														 | 
														
															         for item in videos: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             video_id, flow_pool = item['videoId'], item['flowPool'] 
														 | 
														
														 | 
														
															             video_id, flow_pool = item['videoId'], item['flowPool'] 
														 | 
													
												
											
												
													
														| 
														 | 
														
															             key_name = f"{config_.LOCAL_DISTRIBUTE_COUNT_PREFIX}{video_id}:{flow_pool}" 
														 | 
														
														 | 
														
															             key_name = f"{config_.LOCAL_DISTRIBUTE_COUNT_PREFIX}{video_id}:{flow_pool}" 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1713,7 +1719,8 @@ def get_recommend_params(recommend_type, ab_exp_info, ab_info_data, mid, app_typ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 def video_homepage_recommend(request_id, mid, uid, size, app_type, algo_type, 
														 | 
														
														 | 
														
															 def video_homepage_recommend(request_id, mid, uid, size, app_type, algo_type, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                             client_info, ab_exp_info, params, ab_info_data, version_audit_status, env_dict): 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                             client_info, ab_exp_info, params, ab_info_data, version_audit_status, env_dict, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                             level_weight): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     """ 
														 | 
														
														 | 
														
															     """ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     首页线上推荐逻辑 
														 | 
														
														 | 
														
															     首页线上推荐逻辑 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     :param request_id: request_id 
														 | 
														
														 | 
														
															     :param request_id: request_id 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1816,8 +1823,9 @@ def video_homepage_recommend(request_id, mid, uid, size, app_type, algo_type, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                      algo_type='', client_info=client_info, 
														 | 
														
														 | 
														
															                                      algo_type='', client_info=client_info, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                      ab_code=ab_code, expire_time=expire_time, 
														 | 
														
														 | 
														
															                                      ab_code=ab_code, expire_time=expire_time, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                      rule_key=rule_key, data_key=data_key, no_op_flag=no_op_flag, 
														 | 
														
														 | 
														
															                                      rule_key=rule_key, data_key=data_key, no_op_flag=no_op_flag, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                     old_video_index=old_video_index, video_id= None, 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                     params=params, rule_key_30day=rule_key_30day, shield_config=shield_config, env_dict=env_dict) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                     old_video_index=old_video_index, video_id=None, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                     params=params, rule_key_30day=rule_key_30day, shield_config=shield_config, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                               env_dict=env_dict, level_weight=level_weight) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         recommend_result['fea_info'] = fea_info 
														 | 
														
														 | 
														
															         recommend_result['fea_info'] = fea_info 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     else: 
														 | 
														
														 | 
														
															     else: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         result = video_recommend(request_id=request_id, 
														 | 
														
														 | 
														
															         result = video_recommend(request_id=request_id, 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1827,7 +1835,8 @@ def video_homepage_recommend(request_id, mid, uid, size, app_type, algo_type, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                              ab_code=ab_code, expire_time=expire_time, 
														 | 
														
														 | 
														
															                              ab_code=ab_code, expire_time=expire_time, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                              rule_key=rule_key, data_key=data_key, 
														 | 
														
														 | 
														
															                              rule_key=rule_key, data_key=data_key, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                              no_op_flag=no_op_flag, old_video_index=old_video_index, 
														 | 
														
														 | 
														
															                              no_op_flag=no_op_flag, old_video_index=old_video_index, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                             params=params, rule_key_30day=rule_key_30day, shield_config=shield_config) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                             params=params, rule_key_30day=rule_key_30day, shield_config=shield_config, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                 level_weight=level_weight) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     # log_.info({ 
														 | 
														
														 | 
														
															     # log_.info({ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     #     'logTimestamp': int(time.time() * 1000), 
														 | 
														
														 | 
														
															     #     'logTimestamp': int(time.time() * 1000), 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     #     'request_id': request_id, 
														 | 
														
														 | 
														
															     #     'request_id': request_id, 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1855,7 +1864,7 @@ def video_homepage_recommend(request_id, mid, uid, size, app_type, algo_type, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     # else: 
														 | 
														
														 | 
														
															     # else: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     #     update_redis_data(result=rank_result, app_type=app_type, mid=mid, top_K=top_K) 
														 | 
														
														 | 
														
															     #     update_redis_data(result=rank_result, app_type=app_type, mid=mid, top_K=top_K) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    update_redis_data(result=rank_result, app_type=app_type, mid=mid, top_K=top_K) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    update_redis_data(result=rank_result, app_type=app_type, mid=mid, top_K=top_K, level_weight=level_weight) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     # log_.info({ 
														 | 
														
														 | 
														
															     # log_.info({ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     #     'logTimestamp': int(time.time() * 1000), 
														 | 
														
														 | 
														
															     #     'logTimestamp': int(time.time() * 1000), 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1873,7 +1882,7 @@ def video_homepage_recommend(request_id, mid, uid, size, app_type, algo_type, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															 def video_relevant_recommend(request_id, video_id, mid, uid, size, app_type, ab_exp_info, client_info, 
														 | 
														
														 | 
														
															 def video_relevant_recommend(request_id, video_id, mid, uid, size, app_type, ab_exp_info, client_info, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                             page_type, params, ab_info_data, version_audit_status, env_dict): 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                             page_type, params, ab_info_data, version_audit_status, env_dict, level_weight): 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     """ 
														 | 
														
														 | 
														
															     """ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     相关推荐逻辑 
														 | 
														
														 | 
														
															     相关推荐逻辑 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     :param request_id: request_id 
														 | 
														
														 | 
														
															     :param request_id: request_id 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1937,7 +1946,8 @@ def video_relevant_recommend(request_id, video_id, mid, uid, size, app_type, ab_ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                  ab_code=ab_code, expire_time=expire_time, 
														 | 
														
														 | 
														
															                                  ab_code=ab_code, expire_time=expire_time, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                  rule_key=rule_key, data_key=data_key, no_op_flag=no_op_flag, 
														 | 
														
														 | 
														
															                                  rule_key=rule_key, data_key=data_key, no_op_flag=no_op_flag, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                                  old_video_index=old_video_index, video_id=video_id, 
														 | 
														
														 | 
														
															                                  old_video_index=old_video_index, video_id=video_id, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                                 params=params, rule_key_30day=rule_key_30day, shield_config=shield_config, env_dict = env_dict) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                 params=params, rule_key_30day=rule_key_30day, shield_config=shield_config, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                               env_dict=env_dict, level_weight=level_weight) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         recommend_result['fea_info'] = fea_info 
														 | 
														
														 | 
														
															         recommend_result['fea_info'] = fea_info 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     else: 
														 | 
														
														 | 
														
															     else: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															         result = video_recommend(request_id=request_id, 
														 | 
														
														 | 
														
															         result = video_recommend(request_id=request_id, 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1947,7 +1957,8 @@ def video_relevant_recommend(request_id, video_id, mid, uid, size, app_type, ab_ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                              ab_code=ab_code, expire_time=expire_time, 
														 | 
														
														 | 
														
															                              ab_code=ab_code, expire_time=expire_time, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                              rule_key=rule_key, data_key=data_key, no_op_flag=no_op_flag, 
														 | 
														
														 | 
														
															                              rule_key=rule_key, data_key=data_key, no_op_flag=no_op_flag, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															                              old_video_index=old_video_index, video_id=video_id, 
														 | 
														
														 | 
														
															                              old_video_index=old_video_index, video_id=video_id, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															-                             params=params, rule_key_30day=rule_key_30day, shield_config=shield_config) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                             params=params, rule_key_30day=rule_key_30day, shield_config=shield_config, 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+                                 level_weight=level_weight) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     # log_.info({ 
														 | 
														
														 | 
														
															     # log_.info({ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     #     'logTimestamp': int(time.time() * 1000), 
														 | 
														
														 | 
														
															     #     'logTimestamp': int(time.time() * 1000), 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     #     'request_id': request_id, 
														 | 
														
														 | 
														
															     #     'request_id': request_id, 
														 | 
													
												
											
										
											
												
													
														 | 
														
															@@ -1976,7 +1987,7 @@ def video_relevant_recommend(request_id, video_id, mid, uid, size, app_type, ab_ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     # else: 
														 | 
														
														 | 
														
															     # else: 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     #      update_redis_data(result=rank_result, app_type=app_type, mid=mid, top_K=top_K) 
														 | 
														
														 | 
														
															     #      update_redis_data(result=rank_result, app_type=app_type, mid=mid, top_K=top_K) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															-    update_redis_data(result=rank_result, app_type=app_type, mid=mid, top_K=top_K) 
														 | 
														
														 | 
														
															 
														 | 
													
												
											
												
													
														| 
														 | 
														
															 
														 | 
														
														 | 
														
															+    update_redis_data(result=rank_result, app_type=app_type, mid=mid, top_K=top_K, level_weight=level_weight) 
														 | 
													
												
											
												
													
														| 
														 | 
														
															  
														 | 
														
														 | 
														
															  
														 | 
													
												
											
												
													
														| 
														 | 
														
															     # log_.info({ 
														 | 
														
														 | 
														
															     # log_.info({ 
														 | 
													
												
											
												
													
														| 
														 | 
														
															     #     'logTimestamp': int(time.time() * 1000), 
														 | 
														
														 | 
														
															     #     'logTimestamp': int(time.time() * 1000), 
														 |