def METHOD_NAME(self, count, hist_value):
    if self.value is not None:
        self.value += (self.d * (hist_value - self.value))
        self.is_calculated = True
    elif self.k == 0:
        self.value = hist_value
        self.is_calculated = True
    elif count >= self.sample_size and self.k >= self.sample_size:
        self.value = hist_value
        self.is_calculated = True
    elif (self.k + self.d) < count:
        self.value = hist_value
        self.is_calculated = True
    else:
        self.value = hist_value