def get_search_rank_from_exp_summary(exp_summary):
 rating_weightings = {'1': (-5), '2': (-2), '3': 2, '4': 5, '5': 10}
 rank = (_DEFAULT_RANK + (_STATUS_PUBLICIZED_BONUS if (exp_summary.status == rights_manager.ACTIVITY_STATUS_PUBLICIZED) else 0))
 if exp_summary.ratings:
  for rating_value in exp_summary.ratings:
   rank += (exp_summary.ratings[rating_value] * rating_weightings[rating_value])
 return max(rank, 0)

def get_search_rank_from_exp_summary ( exp_summary ) : rating_weightings = { '1' : ( - 5 ) , '2' : ( - 2 ) , '3' : 2 , '4' : 5 , '5' : 10 } rank = ( _DEFAULT_RANK + ( _STATUS_PUBLICIZED_BONUS if ( exp_summary . status == rights_manager . ACTIVITY_STATUS_PUBLICIZED ) else 0 ) ) if exp_summary . ratings : for rating_value in exp_summary . ratings : rank += ( exp_summary . ratings [ rating_value ] * rating_weightings [ rating_value ] ) return max ( rank , 0 )
returns an integer determining the documents rank in search .