def METHOD_NAME(img_data):
    data = BytesIO(img_data)
    img = Image.open(data)
    if img.mode == 'P':
        img = img.convert('RGBA')
    if img.mode == 'RGBA':
        return any(img.histogram()[-256:-1])
    raise NotImplementedError(
        'assert_is_transparent works only for RGBA images, got %s image' % img.mode)