Design and implement a scoring calculator for a game of Yatzy, ensuring all edge cases and scoring categories are handled.
Implement score_yatzy(dice, category), where dice contains exactly five integers from 1 through 6 and category is one of ones through sixes, one_pair, two_pairs, three_kind, four_kind, small_straight, large_straight, full_house, chance, or yatzy. Return the integer score for that category. Upper-section categories sum only matching dice; a full house requires exactly one pair and one three-of-a-kind. Invalid inputs do not need to be handled.
dice contains exactly 5 integers.category is one of the 13 specified category names.def score_yatzy(dice, category):