def METHOD_NAME(cls, value_name, needs_check, emit):
    emit(
        "if ((%s.validity & NUITKA_ILONG_OBJECT_VALID) == NUITKA_ILONG_OBJECT_VALID) {"
        % value_name
    )
    # TODO: Have a derived C type that does it.
    if needs_check:
        template = template_release_object_unclear
    else:
        template = template_release_object_clear
    emit(template % {"identifier": "%s.ilong_object" % value_name})
    emit("}")