def reviews_grades(): id_grades = rp.id_grades() id_review = gender.id_reviews() grades_keys = list(id_grades.keys()) review_keys = list(id_review.keys()) return [(id_grades[id], id_review[id]) for id in user_ids if id in set(grades_keys).intersection(review_keys)]
def stars_grades(): id_grades = rp.id_grades() id_star = gender.id_stars() grades_keys = list(id_grades.keys()) star_keys = list(id_star.keys()) return [(id_grades[id], id_star[id]) for id in user_ids if id in set(grades_keys).intersection(star_keys)]