def update_model(graph: Graph, ckcore_base_uri: str, dump_json: bool=False):
    model_uri = f'{ckcore_base_uri}/model'
    log.debug(f'Updating model via {model_uri}')
    model_json = json.dumps(graph.export_model(), indent=4)
    if dump_json:
        with open('model.dump.json', 'w') as model_outfile:
            model_outfile.write(model_json)
    headers = {}
    if getattr(ArgumentParser.args, 'psk', None):
        encode_jwt_to_headers(headers, {}, ArgumentParser.args.psk)
    r = requests.patch(model_uri, data=model_json, headers=headers)
    if (r.status_code != 200):
        log.error(r.content)
        raise RuntimeError(f'Failed to create model: {r.content}')
def update_model(graph: Graph, ckcore_base_uri: str, dump_json: bool=False):
    model_uri = f'{ckcore_base_uri}/model'
    log.debug(f'Updating model via {model_uri}')
    model_json = json.dumps(graph.export_model(), indent=4)
    if dump_json:
        with open('model.dump.json', 'w') as model_outfile:
            model_outfile.write(model_json)
    headers = {}
    if getattr(ArgumentParser.args, 'psk', None):
        encode_jwt_to_headers(headers, {}, ArgumentParser.args.psk)
    r = requests.patch(model_uri, data=model_json, headers=headers)
    if (r.status_code != 200):
        log.error(r.content)
        raise RuntimeError(f'Failed to create model: {r.content}')