<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sheets(self, index=None):
 """Return either a list of all sheets if index is None, or the sheet at the given index."""

    if self._sheets is None:
      self._sheets = [self.get_worksheet(s, i) for i, s in enumerate(self.iterate_sheets())]
    if index is None:
      return self._sheets
    else:
      return self._sheets[index]