def append(self, v, is_teacher=False):
    if (self.length < self.maxlen):
        self.length += 1
        if is_teacher:
            self.teach_idx += 1
    elif (self.length == self.maxlen):
        self.start = max(self.teach_idx, ((self.start + 1) % self.maxlen))
    else:
        raise RuntimeError()
    self.data[(((self.start + self.length) - 1) % self.maxlen)] = v
def append(self, v, is_teacher=False):
    if (self.length < self.maxlen):
        self.length += 1
        if is_teacher:
            self.teach_idx += 1
    elif (self.length == self.maxlen):
        self.start = max(self.teach_idx, ((self.start + 1) % self.maxlen))
    else:
        raise RuntimeError()
    self.data[(((self.start + self.length) - 1) % self.maxlen)] = v