# Path: zabby/core/exceptions.py
# class WrongArgumentError(Exception):
#     """ Wrong argument was passed to a function"""
# 
# class OperatingSystemError(Exception):
#     """ Operating system behaved in an unusual manner """
# 
# Path: zabby/core/six.py
# PY3 = sys.version_info[0] == 3
#     def b(s):
#     def u(s):
#     def b(s):
#     def u(s):


import socket
import logging
import time
from subprocess import Popen, PIPE
from itertools import islice
from zabby.core.exceptions import WrongArgumentError, OperatingSystemError
from zabby.core.six import binary_type
from __future__ import division



def write_to_file(file_path, value):
    """ Converts value to string and writes it to file followed by newline"""
    with open(file_path, mode='a') as f:
        f.write(str(value))
        f.write("\n")
        f.flush()


def validate_mode(mode, available_modes):
    """
    Checks if mode is one of available_modes

    :raises: WrongArgumentError if mode is not one of available_modes
    """
    if mode not in available_modes:

# Path: zabby/core/exceptions.py
# class WrongArgumentError(Exception):
#     """ Wrong argument was passed to a function"""
# 
# class OperatingSystemError(Exception):
#     """ Operating system behaved in an unusual manner """
# 
# Path: zabby/core/six.py
# PY3 = sys.version_info[0] == 3
#     def b(s):
#     def u(s):
#     def b(s):
#     def u(s):


# Path: zabby/core/utils.py
import socket
import logging
import time
from subprocess import Popen, PIPE
from itertools import islice
from zabby.core.exceptions import WrongArgumentError, OperatingSystemError
from zabby.core.six import binary_type

from __future__ import division



def write_to_file(file_path, value):
    """ Converts value to string and writes it to file followed by newline"""
    with open(file_path, mode='a') as f:
        f.write(str(value))
        f.write("\n")
        f.flush()


def validate_mode(mode, available_modes):
    """
    Checks if mode is one of available_modes

    :raises: WrongArgumentError if mode is not one of available_modes
    """
    if mode not in available_modes:

        raise WrongArgumentError(