<commit_before>from crits.core.crits_mongoengine import EmbeddedObject

from cybox.common import String, PositiveInteger, StructuredText

from cybox.objects.account_object import Account
from cybox.objects.address_object import Address
from cybox.objects.api_object import API
from cybox.objects.artifact_object import Artifact
from cybox.objects.code_object import Code
from cybox.objects.disk_object import Disk
from cybox.objects.disk_partition_object import DiskPartition
from cybox.objects.domain_name_object import DomainName
from cybox.objects.dns_query_object import DNSQuery, DNSQuestion, DNSRecord
from cybox.objects.email_message_object import EmailMessage
from cybox.objects.gui_dialogbox_object import GUIDialogbox
from cybox.objects.gui_object import GUI
from cybox.objects.gui_window_object import GUIWindow
from cybox.objects.http_session_object import HTTPRequestHeaderFields
from cybox.objects.library_object import Library
from cybox.objects.memory_object import Memory
from cybox.objects.mutex_object import Mutex
from cybox.objects.network_connection_object import NetworkConnection
from cybox.objects.pipe_object import Pipe
from cybox.objects.port_object import Port
from cybox.objects.process_object import Process
from cybox.objects.system_object import System
from cybox.objects.uri_object import URI
from cybox.objects.user_account_object import UserAccount
from cybox.objects.volume_object import Volume
from cybox.objects.win_driver_object import WinDriver
from cybox.objects.win_event_object import WinEvent
from cybox.objects.win_event_log_object import WinEventLog
from cybox.objects.win_handle_object import WinHandle
from cybox.objects.win_kernel_hook_object import WinKernelHook
from cybox.objects.win_mailslot_object import WinMailslot
from cybox.objects.win_network_share_object import WinNetworkShare
from cybox.objects.win_process_object import WinProcess
from cybox.objects.win_registry_key_object import WinRegistryKey
from cybox.objects.win_service_object import WinService
from cybox.objects.win_system_object import WinSystem
from cybox.objects.win_task_object import WinTask
from cybox.objects.win_user_object import WinUser
from cybox.objects.win_volume_object import WinVolume
from cybox.objects.x509_certificate_object import X509Certificate

class UnsupportedCybOXObjectTypeError(Exception):
    """
    Exception to return if we've detected an unknown CybOX object type.
    """

    def __init__(self, type_, name, **kwargs):
        self.message = ('"%s - %s" is currently unsupported'
                   " for output to CybOX." % (type_, name))

    def __str__(self):
        return repr(self.message)

class UnsupportedCRITsObjectTypeError(Exception):
    """
    Exception to return if we've detected an unknown CRITs object type.
    """

    def __init__(self, cybox_obj, **kwargs):
        self.message = ('"%s" is currently unsupported'
                   " for input into CRITs." % (cybox_obj))

    def __str__(self):
        return repr(self.message)

def make_cybox_object(type_, name=None, value=None):
    """<commit_msg>More user friendly error message<commit_after>from crits.core.crits_mongoengine import EmbeddedObject

from cybox.common import String, PositiveInteger, StructuredText

from cybox.objects.account_object import Account
from cybox.objects.address_object import Address
from cybox.objects.api_object import API
from cybox.objects.artifact_object import Artifact
from cybox.objects.code_object import Code
from cybox.objects.disk_object import Disk
from cybox.objects.disk_partition_object import DiskPartition
from cybox.objects.domain_name_object import DomainName
from cybox.objects.dns_query_object import DNSQuery, DNSQuestion, DNSRecord
from cybox.objects.email_message_object import EmailMessage
from cybox.objects.gui_dialogbox_object import GUIDialogbox
from cybox.objects.gui_object import GUI
from cybox.objects.gui_window_object import GUIWindow
from cybox.objects.http_session_object import HTTPRequestHeaderFields
from cybox.objects.library_object import Library
from cybox.objects.memory_object import Memory
from cybox.objects.mutex_object import Mutex
from cybox.objects.network_connection_object import NetworkConnection
from cybox.objects.pipe_object import Pipe
from cybox.objects.port_object import Port
from cybox.objects.process_object import Process
from cybox.objects.system_object import System
from cybox.objects.uri_object import URI
from cybox.objects.user_account_object import UserAccount
from cybox.objects.volume_object import Volume
from cybox.objects.win_driver_object import WinDriver
from cybox.objects.win_event_object import WinEvent
from cybox.objects.win_event_log_object import WinEventLog
from cybox.objects.win_handle_object import WinHandle
from cybox.objects.win_kernel_hook_object import WinKernelHook
from cybox.objects.win_mailslot_object import WinMailslot
from cybox.objects.win_network_share_object import WinNetworkShare
from cybox.objects.win_process_object import WinProcess
from cybox.objects.win_registry_key_object import WinRegistryKey
from cybox.objects.win_service_object import WinService
from cybox.objects.win_system_object import WinSystem
from cybox.objects.win_task_object import WinTask
from cybox.objects.win_user_object import WinUser
from cybox.objects.win_volume_object import WinVolume
from cybox.objects.x509_certificate_object import X509Certificate

class UnsupportedCybOXObjectTypeError(Exception):
    """
    Exception to return if we've detected an unknown CybOX object type.
    """

    def __init__(self, type_, name, **kwargs):
        self.message = ('"%s - %s" is currently unsupported'
                   " for output to CybOX." % (type_, name))

    def __str__(self):
        return repr(self.message)

class UnsupportedCRITsObjectTypeError(Exception):
    """
    Exception to return if we've detected an unknown CRITs object type.
    """

    def __init__(self, cybox_obj, **kwargs):
        self.message = ('"%s" is currently unsupported'
                   " for input into CRITs." % (type(cybox_obj).__name__))

    def __str__(self):
        return repr(self.message)

def make_cybox_object(type_, name=None, value=None):
    """
{'fraction_non_alphanumeric': 0.05911726804123711, 'fraction_numerical': 0.0019329896907216496, 'mean_word_length': 5.60531914893617, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4014998', 'n_tokens_mistral': 1779, 'n_tokens_neox': 1718, 'n_words': 486}