def resize_image(src, dst, size=None, remove_src=True, locally=False):
    if src == dst:
        raise Exception("src and dst can't be the same: %s" % src)

    open_ = open if locally else storage.open
    delete = os.unlink if locally else storage.delete

    with open_(src, 'rb') as fp:
        im = Image.open(fp)
        im = im.convert('RGBA')
        if size:
            im = processors.scale_and_crop(im, size)
    with open_(dst, 'wb') as fp:
        im.save(fp, 'png')

    if remove_src:
        delete(src)

    return im.size
Create an ad unit tree and display it.
dataset/ETHPy150Open mozilla/addons-server/src/olympia/amo/utils.py/resize_image--crossover with--dataset/ETHPy150Open googleads/googleads-python-lib/examples/dfp/v201508/inventory_service/get_ad_unit_hierarchy.py/BuildAndDisplayAdUnitTree