def update(config, args):
    url = config['url'] + "/api/serveroverload/" + args['serveroverload'] + "/"

    data = {}

    if args['name'] is not None:
        data['name'] = args['name']

    if args['description'] is not None:
        data['description'] = args['description']

    update_function = False
    function = {}

    if args['functiontype'] is not None:
        function['type'] = args['functiontype']
        update_function = True

    if args['functionexpvalue'] is not None:
        function['expValue'] = args['functionexpvalue']
        update_function = True

    if args['functiongrowthrate'] is not None:
        function['growthRate'] = args['functiongrowthrate']
        update_function = True

    if update_function is True:  # verify they provided all the pieces needed to update a function
        try:
            assert "type" in function
            assert "expValue" in function
            assert "growthRate" in function
            data['function'] = function
        except AssertionError:
            print("To update a function, you must provide the type, expvalue, and growthrate together.")
            sys.exit(1)

    token = auth.get_token(config)
    r = requests.put(url, data=json.dumps(data), headers={"X-Auth-Token": token})
    print("API returned status code %s" % (r.status_code))
dataset/ETHPy150Open emccode/heliosburn/heliosburn/hbcli/controllers/serveroverload.py/update/original