@staticmethod
def __encode_record(record):
    """
        Class for encode the record for correct send
        :param record: the record to encode
        :return: record encoded for PY3
        """
    if not isinstance(record, bytes):
        return record.encode('utf-8')
    return record
