<commit_before># -*- encoding: utf-8 -*-
from supriya.tools import osctools
from supriya.tools.requesttools.Request import Request


class SynthDefReceiveRequest(Request):
    r'''A /d_recv request.
    '''

    ### CLASS VARIABLES ###

    __slots__ = (
        '_synthdefs',
        )

    ### INITIALIZER ###

    def __init__(
        self,
        synthdefs=None,
        ):
        from supriya.tools import synthdeftools
        Request.__init__(self)
        if synthdefs:
            prototype = synthdeftools.SynthDef 
            assert all(isinstance(x, prototype) for x in synthdefs)
            synthdefs = tuple(synthdefs)
        self._synthdefs = synthdefs

    ### PUBLIC METHODS ###

    def to_osc_message(self):
        from supriya.tools import synthdeftools
        request_id = int(self.request_id)
        compiled_synthdefs = synthdeftools.SynthDefCompiler.compile_synthdefs(
            self.synthdefs,
            )
        compiled_synthdefs = bytearray(compiled_synthdefs)
        message = osctools.OscMessage(
            request_id,
            compiled_synthdefs,
            )
        return message

    ### PUBLIC PROPERTIES ###

    @property
    def response_specification(self):
        return None
<commit_msg>Added `completion_message` to SynthDefReceiveRequest.<commit_after># -*- encoding: utf-8 -*-
from supriya.tools import osctools
from supriya.tools.requesttools.Request import Request


class SynthDefReceiveRequest(Request):
    r'''A /d_recv request.
    '''

    ### CLASS VARIABLES ###

    __slots__ = (
        '_completion_message',
        '_synthdefs',
        )

    ### INITIALIZER ###

    def __init__(
        self,
        completion_message=None,
        synthdefs=None,
        ):
        from supriya.tools import synthdeftools
        Request.__init__(self)
        self._completion_message = completion_message
        if synthdefs:
            prototype = synthdeftools.SynthDef 
            assert all(isinstance(x, prototype) for x in synthdefs)
            synthdefs = tuple(synthdefs)
        self._synthdefs = synthdefs

    ### PUBLIC METHODS ###

    def to_osc_message(self):
        from supriya.tools import synthdeftools
        request_id = int(self.request_id)
        compiled_synthdefs = synthdeftools.SynthDefCompiler.compile_synthdefs(
            self.synthdefs,
            )
        compiled_synthdefs = bytearray(compiled_synthdefs)
        contents = [
            request_id,
            compiled_synthdefs,
            ]
        if self.completion_message:
            completion_message = self.completion_message.to_datagram()
            completion_message = bytearray(completion_message)
            contents.append(completion_message)
        message = osctools.OscMessage(*contents)
        return message

    ### PUBLIC PROPERTIES ###

    @property
    def completion_message(self):
        return self._completion_message
    
    @property
    def response_specification(self):
        return None

{'fraction_non_alphanumeric': 0.08261159227181879, 'fraction_numerical': 0.0006662225183211193, 'mean_word_length': 2.25, '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': '6982349', 'n_tokens_mistral': 920, 'n_tokens_neox': 868, 'n_words': 166}