def generateDictOperationUpdateCode(statement, emit, context):
    value_arg_name = context.allocateTempName("dictupdate_value", unique = True)
    generateExpressionCode(
        to_name    = value_arg_name,
        expression = statement.getValue(),
        emit       = emit,
        context    = context
    )

    dict_arg_name = context.allocateTempName("dictupdate_dict", unique = True)
    generateExpressionCode(
        to_name    = dict_arg_name,
        expression = statement.getDict(),
        emit       = emit,
        context    = context
    )

    res_name = context.getIntResName()

    emit("assert( PyDict_Check( %s ) );" % dict_arg_name)
    emit(
        "%s = PyDict_Update( %s, %s );" % (
            res_name,
            dict_arg_name,
            value_arg_name
        )
    )

    getReleaseCodes(
        release_names = (dict_arg_name, value_arg_name),
        emit          = emit,
        context       = context
    )

    getErrorExitBoolCode(
        condition   = "%s == -1" % res_name,
        needs_check = statement.mayRaiseException(BaseException),
        emit        = emit,
        context     = context
    )
dataset/ETHPy150Open kayhayen/Nuitka/nuitka/codegen/DictCodes.py/generateDictOperationUpdateCode/original