def decode_if_needed(data):
    if data.startswith('data') and 'base64' in data:
        # remove data URL prefixes
        data = data.split('base64,', 1)[1]
        data = base64.standard_b64decode(data)
    return data
dataset/ETHPy150Open GoogleCloudPlatform/appengine-opencv-sudoku-python/main.py/decode_if_needed/original