<commit_before>from blackwidow.network.packet import Packet
from event import Event
from Queue import PriorityQueue

class Data(object):
    def __init__(self, time, size):
        self._time = time
        self._size = size

    @property
    def time(self):
        return self._time

    @time.setter
    def time(self, value):
        raise AttributeError("Cannot change time")

    @property
    def size(self):
        return self._size

    @size.setter
    def size(self, value):
        raise AttributeError("Cannot change size")

    def __cmp__(self, other):
        return cmp(self._time, other.time)

class Rate_Graph(object):
    """Class to graph rates.
    """
    def __init__(self, object_id, name, env, bw):
        """ Constructor for Rate_Graph class
        """
        self.name = name
        self.env = env
        self.bw = bw
        self.object_id = object_id
        self.window_size = 1000
        self.window = PriorityQueue()
        self.bits_in_window = 0<commit_msg>Finished commenting Data object in RateGraph<commit_after>from blackwidow.network.packet import Packet
from event import Event
from Queue import PriorityQueue

class Data(object):
    """ Class to represent an amount of data and the time it was sent.
        It is used as a priority queue object with time as the priority.
    """
    def __init__(self, time, size):
        self._time = time
        self._size = size

    @property
    def time(self):
        return self._time

    @time.setter
    def time(self, value):
        raise AttributeError("Cannot change time")

    @property
    def size(self):
        return self._size

    @size.setter
    def size(self, value):
        raise AttributeError("Cannot change size")

    def __cmp__(self, other):
    """ Method to compare with other objects in the priority queue.
    """
        return cmp(self._time, other.time)

class Rate_Graph(object):
    """ Class to graph rates.
    """
    def __init__(self, object_id, name, env, bw):
        """ Constructor for Rate_Graph class
        """
        self.name = name
        self.env = env
        self.bw = bw
        self.object_id = object_id
        self.window_size = 1000
        self.window = PriorityQueue()
        self.bits_in_window = 0
{'fraction_non_alphanumeric': 0.09062776304155615, 'fraction_numerical': 0.004420866489832007, 'mean_word_length': 2.357566765578635, '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': '3502178', 'n_tokens_mistral': 662, 'n_tokens_neox': 634, 'n_words': 208}