def deploy_rpc_test_contract(deploy_client, name):
    contract_path, contracts = get_test_contract(f"{name}.sol")
    contract_proxy, _ = deploy_client.deploy_solidity_contract(
        name, contracts, libraries=dict(), constructor_parameters=None, contract_path=contract_path
    )

    return contract_proxy
def image_thumbnail(filename):
    filepath = os.path.join(app.config.get('UPLOAD_FOLDER'), filename)
    im = Image.open(filepath)
    w, h = im.size

    if w > h:
        im.thumbnail((106, 106*h/w))
    else:
        im.thumbnail((106*w/h, 106))

    im.save(os.path.join(app.config.get('UPLOAD_FOLDER'), 
        os.path.splitext(filename)[0] + '_thumbnail' + os.path.splitext(filename)[1]))