class TrainingSetGenerator(object):
    def __init__(self,
                 device_name,
                 device_id,
                 host,
                 headers,
                 file_path='training_set.csv'):
        self.subscriber = PikaSubscriber(device_name, device_id, host)
        self.dataset_writer = DatasetWriter(headers, file_path)

    def start(self):
        """
    Consume and write data to file
    :return:
    """
        self.subscriber.connect()
        self.dataset_writer.open()
        self.subscriber.consume_messages(self.dataset_writer.write)

    def stop(self):
        """
    Unsubscribe and close file
    :return:
    """
        self.subscriber.disconnect()
        self.dataset_writer.close()
 def __init__(self,
              device_name,
              device_id,
              host,
              headers,
              file_path='training_set.csv'):
     self.subscriber = PikaSubscriber(device_name, device_id, host)
     self.dataset_writer = DatasetWriter(headers, file_path)
class TrainingSetGenerator(object):
    def __init__(self, device_name, device_id, host, headers, file_path="training_set.csv"):
        self.subscriber = PikaSubscriber(device_name, device_id, host)
        self.dataset_writer = DatasetWriter(headers, file_path)

    def start(self):
        """
    Consume and write data to file
    :return:
    """
        self.subscriber.connect()
        self.dataset_writer.open()
        self.subscriber.consume_messages(self.dataset_writer.write)

    def stop(self):
        """
    Unsubscribe and close file
    :return:
    """
        self.subscriber.disconnect()
        self.dataset_writer.close()
 def __init__(self, device_name, device_id, host, headers, file_path="training_set.csv"):
     self.subscriber = PikaSubscriber(device_name, device_id, host)
     self.dataset_writer = DatasetWriter(headers, file_path)