<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _write_indexlist(self, name):
 """Write a list of indexes."""

        d = [self._site.timeline.index(p) for p in getattr(self._site, name)]
        self.db.delete('site:{0}'.format(name))
        if d:
            self.db.rpush('site:{0}'.format(name), *d)