Beispiel #1
0
def test():
	setup_logging()
	logger = logging.getLogger(__name__)
	logger.info('first log message')
Beispiel #2
0
import os
import logging
import functools
import json

from logging_setup import setup_logging
setup_logging()
from pika_client.environment_variables import EnvironmentVariable
from pika_client.base import Connector
from pika_client.consumers import BasePubSubConsumer

LOGGER = logging.getLogger(__name__)
FROM_EMAIL = os.environ.get('FROM_EMAIL', '*****@*****.**')


class EmailConsumer(BasePubSubConsumer):
    def __init__(
            self,
            service,
            connector,
            app_id='EMAIL_SERVICE',
            queue='emails',
            durable=False,
            exchange='notifications_x',
            exchange_type='topic',
            routing_key='notifications.email'):
        super().__init__(
            connector,
            app_id=app_id,
            queue=queue,
            durable=durable,
Beispiel #3
0
def test():
    setup_logging()
    logger = logging.getLogger(__name__)
    logger.info('first log message')
Beispiel #4
0
    beam_tx = alib.e3d_array_beam_stage1_dense_interp(az0=0,
                                                      el0=90.0,
                                                      I_0=10**4.2)
    beam_rx = alib.e3d_array_beam_interp(az0=0, el0=90.0, I_0=10**4.5)
    radar.set_beam(beam_tx, 'TX')
    radar.set_beam(beam_rx, 'RX')

    #plot_scan_for_object(obj, radar, 0.0, 1.5*24.0*3600.0)

    #radar.set_scan(rs2)
    #plot_scan_for_object(obj, radar, 0.0, 12.0*3600.0)

    #exit()

    logger = logging_setup.setup_logging(
        term_level=logging.DEBUG,
        logfile=False,
    )

    det_times = get_detections(obj,
                               radar,
                               0.0,
                               1.0 * 24.0 * 3600.0,
                               logger=None)

    #print(det_times)

    total_dets = len(det_times[0]["snr"])
    print('total_dets: {}'.format(total_dets))

    if total_dets > 0:
        max_snr = n.max(det_times[0]["snr"])

"""
    results = {}
    for report in reports:
        if report in reports_train:
            res = 'train'
        else:
            prediction = predictions[reports_test.index(report)]
            res = '{} {}'.format(
                'true' if prediction == report.category else 'false',
                'positive' if prediction == CATEGORY_MALICIOUS else 'negative'
            )
        results[report.name] = res
    with open(os.path.join(log_dir, 'results.json'), 'w') as f:
        json.dump(results, f, indent=4)

    joblib.dump(clf, os.path.join(log_dir, 'clf.pkl'))
    joblib.dump(ml.vec, os.path.join(log_dir, 'vec.pkl'))
    joblib.dump(ml.imp, os.path.join(log_dir, 'imp.pkl'))
    #joblib.dump(ml.scaler, os.path.join(log_dir, 'scaler.pkl'))
"""

# Precision = (# correctly predicted pos) / (# predicted pos), recall = (# correctly predicted pos) / (# actual positive)
# logger.info(str(classification_report(y_test, predictions, target_names=['benign', 'malware'])))

if __name__ == '__main__':
    from logging_setup import setup_logging
    log_dir = setup_logging(from_file=__file__)
    main()
def test_log():
    setup_logging()
    logger = logging.getLogger(__name__)
    logger.info('Hello message')