<commit_before>import logging


log = logging.getLogger('pyembree')

cdef void print_error(RTCError code):
    if code == RTC_NO_ERROR:
        log.error("ERROR: No error")
    elif code == RTC_UNKNOWN_ERROR:
        log.error("ERROR: Unknown error")
    elif code == RTC_INVALID_ARGUMENT:
        log.error("ERROR: Invalid argument")
    elif code == RTC_INVALID_OPERATION:
        log.error("ERROR: Invalid operation")
    elif code == RTC_OUT_OF_MEMORY:
        log.error("ERROR: Out of memory")
    elif code == RTC_UNSUPPORTED_CPU:
        log.error("ERROR: Unsupported CPU")
    elif code == RTC_CANCELLED:
        log.error("ERROR: Cancelled")
    else:
        raise RuntimeError


cdef class EmbreeDevice:
    def __init__(self):
        self.device = rtcNewDevice(NULL)

    def __dealloc__(self):
        rtcDeleteDevice(self.device)<commit_msg>Added Embree version in EmbreeDevice<commit_after>import logging


log = logging.getLogger('pyembree')

cdef void print_error(RTCError code):
    if code == RTC_NO_ERROR:
        log.error("ERROR: No error")
    elif code == RTC_UNKNOWN_ERROR:
        log.error("ERROR: Unknown error")
    elif code == RTC_INVALID_ARGUMENT:
        log.error("ERROR: Invalid argument")
    elif code == RTC_INVALID_OPERATION:
        log.error("ERROR: Invalid operation")
    elif code == RTC_OUT_OF_MEMORY:
        log.error("ERROR: Out of memory")
    elif code == RTC_UNSUPPORTED_CPU:
        log.error("ERROR: Unsupported CPU")
    elif code == RTC_CANCELLED:
        log.error("ERROR: Cancelled")
    else:
        raise RuntimeError


cdef class EmbreeDevice:
    def __init__(self):
        self.device = rtcNewDevice(NULL)

    def __dealloc__(self):
        rtcDeleteDevice(self.device)

    def __repr__(self):
        return 'Embree version:  {0}.{1}.{2}'.format(RTCORE_VERSION_MAJOR,
                                                     RTCORE_VERSION_MINOR,
                                                     RTCORE_VERSION_PATCH)
{'fraction_non_alphanumeric': 0.10025188916876575, 'fraction_numerical': 0.0015113350125944584, 'mean_word_length': 2.610909090909091, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6496706', 'n_tokens_mistral': 610, 'n_tokens_neox': 583, 'n_words': 137}