<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def iterate_sheets(self, *args, **kwargs):
 """Opens self.filename and reads it with a csv reader. If self.filename ends with .gz, the file will be decompressed with gzip before being passed to csv.reader. If the filename is not a string, it is assumed to be a file-like object which will be passed directly to csv.reader. """

    if isinstance(self.filename, str):
      if self.filename.endswith(".gz") or self.is_gzipped:
        with gzip.open(self.filename, "rt") as rfile:
          reader = csv.reader(rfile, *args, **kwargs)
          yield list(reader)
      else:
        with open(self.filename, "r") as rfile:
          reader = csv.reader(rfile, *args, **kwargs)
          yield list(reader)
    else:
      reader = csv.reader(self.filename, *args, **kwargs)
      yield list(reader)