<commit_before>import logging

from wampy.errors import ProcedureNotFoundError, WampProtocolError
from wampy.messages import Message
from wampy.messages.call import Call

logger = logging.getLogger('wampy.rpc')


class RpcProxy:

    def __init__(self, client):
        self.client = client

    def __getattr__(self, name):
        from .. registry import Registry
        procedures = [v[1] for v in Registry.registration_map.values()]
        if name in procedures:

            def wrapper(*args, **kwargs):
                message = Call(procedure=name, args=args, kwargs=kwargs)
                logger.info(
                    '%s sending message: "%s"', self.client.name, message)
                self.client.send_message(message)
                response = self.client.recv_message()
                wamp_code = response[0]
                if wamp_code != Message.RESULT:
                    raise WampProtocolError(
                        'unexpected message code: "%s"', wamp_code
                    )

                logger.info(
                    '%s got response: "%s"', self.client.name, response)
                results = response[3]
                result = results[0]
                return result

            return wrapper

        raise ProcedureNotFoundError(name)


def register_rpc(wrapped):
    def decorator(fn):
        fn.rpc = True
        return fn
<commit_msg>bug fix: callers registry does not contain callee details<commit_after>import logging

from wampy.errors import WampProtocolError
from wampy.messages import Message
from wampy.messages.call import Call

logger = logging.getLogger('wampy.rpc')


class RpcProxy:

    def __init__(self, client):
        self.client = client

    def __getattr__(self, name):
        def wrapper(*args, **kwargs):
            message = Call(procedure=name, args=args, kwargs=kwargs)
            logger.info(
                '%s sending message: "%s"', self.client.name, message)
            self.client.send_message(message)
            response = self.client.recv_message()
            wamp_code = response[0]
            if wamp_code != Message.RESULT:
                raise WampProtocolError(
                    'unexpected message code: "%s"', wamp_code
                )

            logger.info(
                '%s got response: "%s"', self.client.name, response)
            results = response[3]
            result = results[0]
            return result

        return wrapper


def register_rpc(wrapped):
    def decorator(fn):
        fn.rpc = True
        return fn

{'fraction_non_alphanumeric': 0.08987885892926925, 'fraction_numerical': 0.0027354435326299334, 'mean_word_length': 1.9090909090909092, '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': '2726826', 'n_tokens_mistral': 698, 'n_tokens_neox': 665, 'n_words': 181}