def trim(self, grpos_range, frames=None, flag_mask=0):
        raw_pos = self._scan_from_end(grpos_range, frames=frames,
                                      flag_mask=flag_mask)

        if raw_pos is not None:
            pos = raw_pos - self._s.data_offset
            if pos > 0:
                self._s.data_offset += pos
                self._s.data[:pos] = []

        return defer.succeed(None)
dataset/ETHPy150Open arkadini/twimp/twimp/server/inmemory.py/IMStream.trim/original