<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def removeAllAltWCS(hdulist,extlist):
 """ Removes all alternate WCS solutions from the header """

    original_logging_level = log.level
    log.setLevel(logutil.logging.WARNING)

    try:
        hdr = hdulist[extlist[0]].header
        wkeys = altwcs.wcskeys(hdr)
        if ' ' in wkeys:
            wkeys.remove(' ')
        for extn in extlist:
            for wkey in wkeys:
                if wkey == 'O':
                    continue
                altwcs.deleteWCS(hdulist,extn,wkey)

            # Forcibly remove OPUS WCS Keywords, since deleteWCS will not do it
            hwcs = readAltWCS(hdulist,extn,wcskey='O')

            if hwcs is None:
                continue

            for k in hwcs.keys():
                if k not in ['DATE-OBS','MJD-OBS'] and k in hdr:
                    try:
                        del hdr[k]
                    except KeyError:
                        pass
    except:
        raise

    finally:
        log.setLevel(original_logging_level)