def get_item_similarity(reference_exp_category, reference_exp_language_code, reference_exp_owner_ids, compared_exp_category, compared_exp_language_code, compared_exp_last_updated, compared_exp_owner_ids, compared_exp_status):
 similarity_score = 0
 if (compared_exp_status == rights_manager.ACTIVITY_STATUS_PRIVATE):
  return 0
 elif (compared_exp_status == rights_manager.ACTIVITY_STATUS_PUBLICIZED):
  similarity_score += 1
 similarity_score += (get_topic_similarity(reference_exp_category, compared_exp_category) * 5)
 if (reference_exp_owner_ids == compared_exp_owner_ids):
  similarity_score += 1
 if (reference_exp_language_code == compared_exp_language_code):
  similarity_score += 2
 time_now = datetime.datetime.utcnow()
 time_delta_days = int((time_now - compared_exp_last_updated).days)
 if (time_delta_days <= 7):
  similarity_score += 1
 return similarity_score

def get_item_similarity ( reference_exp_category , reference_exp_language_code , reference_exp_owner_ids , compared_exp_category , compared_exp_language_code , compared_exp_last_updated , compared_exp_owner_ids , compared_exp_status ) : similarity_score = 0 if ( compared_exp_status == rights_manager . ACTIVITY_STATUS_PRIVATE ) : return 0 elif ( compared_exp_status == rights_manager . ACTIVITY_STATUS_PUBLICIZED ) : similarity_score += 1 similarity_score += ( get_topic_similarity ( reference_exp_category , compared_exp_category ) * 5 ) if ( reference_exp_owner_ids == compared_exp_owner_ids ) : similarity_score += 1 if ( reference_exp_language_code == compared_exp_language_code ) : similarity_score += 2 time_now = datetime . datetime . utcnow ( ) time_delta_days = int ( ( time_now - compared_exp_last_updated ) . days ) if ( time_delta_days <= 7 ) : similarity_score += 1 return similarity_score
returns the ranking of compared_exp to reference_exp as a recommendation .