gym_splendor_code/envs/utils/utils_functions.py
def colors_to_gems_collection(tuple_of_gems) -> GemsCollection:
    """Return a gems collection constructed from list of colors:
    Parameters:
     _ _ _ _ _ _
        tuple_of_gems: Tuple of gems (with possible repetitions).

    Returns: A gems collections. Example:
    (red, red, blue, green) is transformed to GemsCollection({red:2, blue:1, green:1, white:0, black:0, gold:0})."""
    gems_dict = {gem_color: 0 for gem_color in GemColor}
    for element in tuple_of_gems:
        gems_dict[element] += 1
    return GemsCollection(gems_dict)
Return a gems collection constructed from list of colors:
    Parameters:
     _ _ _ _ _ _
        tuple_of_gems: Tuple of gems (with possible repetitions).

    Returns: A gems collections. Example:
    (red, red, blue, green) is transformed to GemsCollection({red:2, blue:1, green:1, white:0, black:0, gold:0}).
Return a gems collection constructed from list of colors.
Return a gems collection constructed from list of colors .
def colors_to_gems_collection(tuple_of_gems) -> GemsCollection:
    gems_dict = {gem_color: 0 for gem_color in GemColor}
    for element in tuple_of_gems:
        gems_dict[element] += 1
    return GemsCollection(gems_dict)
def colors_to_gems_collection ( tuple_of_gems ) -> GemsCollection : gems_dict = { gem_color : 0 for gem_color in GemColor } for element in tuple_of_gems : gems_dict [ element ] += 1 return GemsCollection ( gems_dict )
Return a gems collection constructed from list of colors:
Return a gems collection constructed from list of colors :
"""Return a gems collection constructed from list of colors:
    Parameters:
     _ _ _ _ _ _
        tuple_of_gems: Tuple of gems (with possible repetitions).

    Returns: A gems collections. Example:
    (red, red, blue, green) is transformed to GemsCollection({red:2, blue:1, green:1, white:0, black:0, gold:0})."""
tuple_of_gems
_ _ _ _ _ _
    tuple_of_gems
Tuple of gems (with possible repetitions).
Tuple of gems ( with possible repetitions ) .