<commit_before>import asyncio
from abc import abstractmethod
from logging import ERROR, Formatter, getLogger, StreamHandler
from io import StringIO
from threading import Thread
from kyco.utils import log_fmt
import websockets

# hide websocket logs
log = getLogger('websockets.protocol')
log.setLevel(ERROR)

class WebSocket(Thread):
    """Websocket class is used to serve a websocket."""

    def __init__(self, **kwargs):
        """The contructor of this class use the below params.

        Args:
            host (str): name of host used.(defaults: localhost)
            port (int): number of port used to bind the server.(defaults: 6553)
        """
        Thread.__init__(self)
        self.host = kwargs.get('host','localhost')
        self.port = kwargs.get('port', 6553)
        self.event_loop = None
        self.is_running = False

    @abstractmethod
    @asyncio.coroutine
    def handle_msg(self,websocket, path):
        """Abstract method used to handle websocket messages.This method is
        asynchronous.

        Args:
            websocket (websocket.server): websocket.server used.
            path(string): path of the websocket.server.
        """<commit_msg>fixed websocket bind address<commit_after>import asyncio
from abc import abstractmethod
from logging import ERROR, Formatter, getLogger, StreamHandler
from io import StringIO
from threading import Thread
from kyco.utils import log_fmt
import websockets

# hide websocket logs
log = getLogger('websockets.protocol')
log.setLevel(ERROR)

class WebSocket(Thread):
    """Websocket class is used to serve a websocket."""

    def __init__(self, **kwargs):
        """The contructor of this class use the below params.

        Args:
            host (str): name of host used.(defaults: localhost)
            port (int): number of port used to bind the server.(defaults: 6553)
        """
        Thread.__init__(self)
        self.host = kwargs.get('host','0.0.0.0')
        self.port = kwargs.get('port', 6553)
        self.event_loop = None
        self.is_running = False

    @abstractmethod
    @asyncio.coroutine
    def handle_msg(self,websocket, path):
        """Abstract method used to handle websocket messages.This method is
        asynchronous.

        Args:
            websocket (websocket.server): websocket.server used.
            path(string): path of the websocket.server.
        """
{'fraction_non_alphanumeric': 0.09151692436272461, 'fraction_numerical': 0.008357709987463435, 'mean_word_length': 2.842696629213483, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '2721411', 'n_tokens_mistral': 667, 'n_tokens_neox': 646, 'n_words': 221}