<commit_before># coding=utf-8
from contextlib import contextmanager
import Queue
from threading import Lock
import zmq
import response_pb2


class Instance(object):
    def __init__(self, context):
        self.geom = None
        self._sockets = Queue.Queue()
        self.socket_path = None
        self.script = None
        self.nb_created_socket = 0
        self.lock = Lock()
        self.context = context


    @contextmanager
    def socket(self, context):
        socket = None
        try:
            socket = self._sockets.get(block=False)
        except Queue.Empty:
            socket = context.socket(zmq.REQ)
            socket.connect(self.socket_path)
            self.lock.acquire()
            self.nb_created_socket += 1
            self.lock.release()
        try:
            yield socket
        finally:
            if not socket.closed:
                self._sockets.put(socket)<commit_msg>Jormungandr : Add logging dependency<commit_after># coding=utf-8
from contextlib import contextmanager
import Queue
from threading import Lock
import zmq
import response_pb2
import logging

class Instance(object):
    def __init__(self, context):
        self.geom = None
        self._sockets = Queue.Queue()
        self.socket_path = None
        self.script = None
        self.nb_created_socket = 0
        self.lock = Lock()
        self.context = context


    @contextmanager
    def socket(self, context):
        socket = None
        try:
            socket = self._sockets.get(block=False)
        except Queue.Empty:
            socket = context.socket(zmq.REQ)
            socket.connect(self.socket_path)
            self.lock.acquire()
            self.nb_created_socket += 1
            self.lock.release()
        try:
            yield socket
        finally:
            if not socket.closed:
                self._sockets.put(socket)
{'fraction_non_alphanumeric': 0.08070550507749866, 'fraction_numerical': 0.00427578834847675, 'mean_word_length': 1.906832298136646, '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': '6515416', 'n_tokens_mistral': 523, 'n_tokens_neox': 514, 'n_words': 126}