<commit_before>import logging
import dyn.tm.session
from dyn.tm import Active
from dyn.tm.errors import DynectInvalidArgumentError

__author__ = 'jnappi'
__all__ = ['HealthMonitor', 'ActiveFailover']

session = dyn.tm.session.session


class HealthMonitor(object):
    """A health monitor for an :class:`ActiveFailover` service"""
    def __init__(self, protocol, interval, retries=None, timeout=None,
                 port=None, path=None, host=None, header=None, expected=None):
        """Create a :class:`HealthMonitor` object

        :param protocol: The protocol to monitor. Must be either HTTP, HTTPS,
            PING, SMTP, or TCP
        :param interval: How often (in minutes) to run this
            :class:`HealthMonitor`. Must be 1, 5, 10, or 15,
        :param retries: The number of retries the monitor attempts on failure
            before giving up
        :param timeout: The amount of time in seconds before the connection
            attempt times out
        :param port: For HTTP(S)/SMTP/TCP probes, an alternate connection port
        :param path: For HTTP(S) probes, a specific path to request
        :param host: For HTTP(S) probes, a value to pass in to the Host
        :param header: For HTTP(S) probes, additional header fields/values to
            pass in, separated by a newline character.
        :param expected: For HTTP(S) probes, a string to search for in the
            response. For SMTP probes, a string to compare the banner against.
            Failure to find this string means the monitor will report a down
            status.
        """
        super(HealthMonitor, self).__init__()
        self._protocol = protocol
        self._interval = interval<commit_msg>Cleaned up imports<commit_after># -*- coding: utf-8 -*-
import logging

from ..utils import Active
from ..errors import DynectInvalidArgumentError
from ..session import session

__author__ = 'jnappi'
__all__ = ['HealthMonitor', 'ActiveFailover']


class HealthMonitor(object):
    """A health monitor for an :class:`ActiveFailover` service"""
    def __init__(self, protocol, interval, retries=None, timeout=None,
                 port=None, path=None, host=None, header=None, expected=None):
        """Create a :class:`HealthMonitor` object

        :param protocol: The protocol to monitor. Must be either HTTP, HTTPS,
            PING, SMTP, or TCP
        :param interval: How often (in minutes) to run this
            :class:`HealthMonitor`. Must be 1, 5, 10, or 15,
        :param retries: The number of retries the monitor attempts on failure
            before giving up
        :param timeout: The amount of time in seconds before the connection
            attempt times out
        :param port: For HTTP(S)/SMTP/TCP probes, an alternate connection port
        :param path: For HTTP(S) probes, a specific path to request
        :param host: For HTTP(S) probes, a value to pass in to the Host
        :param header: For HTTP(S) probes, additional header fields/values to
            pass in, separated by a newline character.
        :param expected: For HTTP(S) probes, a string to search for in the
            response. For SMTP probes, a string to compare the banner against.
            Failure to find this string means the monitor will report a down
            status.
        """
        super(HealthMonitor, self).__init__()
        self._protocol = protocol
        self._interval = interval
{'fraction_non_alphanumeric': 0.0793002915451895, 'fraction_numerical': 0.0037900874635568515, 'mean_word_length': 2.7212581344902387, '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': '4493033', 'n_tokens_mistral': 902, 'n_tokens_neox': 865, 'n_words': 390}