def mask_stuff(image):
    """Masks pixels likely to be cloud, shadow, water, or snow in a LANDSAT
    image based on the `pixel_qa` band."""
    qa = image.select('pixel_qa')

    shadow = qa.bitwiseAnd(8).eq(0)
    snow = qa.bitwiseAnd(16).eq(0)
    cloud = qa.bitwiseAnd(32).eq(0)
    water = qa.bitwiseAnd(4).eq(0)

    masked = image.updateMask(shadow).updateMask(cloud).updateMask(snow).updateMask(water)

    return masked