def generateDictOperationRemoveCode(statement, emit, context):
    dict_arg_name = context.allocateTempName("dictdel_dict", unique = True)
    generateExpressionCode(
        to_name    = dict_arg_name,
        expression = statement.getDict(),
        emit       = emit,
        context    = context
    )

    key_arg_name = context.allocateTempName("dictdel_key", unique = True)
    generateExpressionCode(
        to_name    = key_arg_name,
        expression = statement.getKey(),
        emit       = emit,
        context    = context
    )

    old_source_ref = context.setCurrentSourceCodeReference(
        statement.getKey().getSourceReference()
           if Options.isFullCompat() else
        statement.getSourceReference()
    )

    res_name = context.getBoolResName()

    emit(
        "%s = DICT_REMOVE_ITEM( %s, %s );" % (
            res_name,
            dict_arg_name,
            key_arg_name
        )
    )

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

    getErrorExitBoolCode(
        condition   = "%s == false" % res_name,
        needs_check = statement.mayRaiseException(BaseException),
        emit        = emit,
        context     = context
    )

    context.setCurrentSourceCodeReference(old_source_ref)
dataset/ETHPy150Open kayhayen/Nuitka/nuitka/codegen/DictCodes.py/generateDictOperationRemoveCode/original