<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_colors(image):
 """Return a Counter containing each color and how often it appears. """

    colors = Counter(pixel for row in image for pixel in row)
    if len(colors) > 256:
        msg = (
            "The maximum number of distinct colors in a GIF is 256 but "
            "this image has {} colors and can't be encoded properly."
        )
        raise RuntimeError(msg.format(len(colors)))
    return colors