code: def open_any(filename):
      
      if filename.endswith(".gz"):
          return gzip.open
  
      if filename.endswith(".bz2"):
          return bz2.BZ2File
  
      return open
docs: Helper to open also compressed files