def METHOD_NAME(filename):
    """
    Sets the ``CHECKSUM`` and ``DATASUM`` keywords for each HDU of `filename`.
    Also updates fixes standards violations if possible and requested.
    """
    output_verify = "silentfix" if OPTIONS.compliance else "ignore"
    # For unit tests we reset temporarily the warning filters. Indeed, before
    # updating the checksums, fits.open will verify the existing checksums and
    # raise warnings, which are later caught and converted to log.warning...
    # which is an issue when testing, using the "error" action to convert
    # warnings to exceptions.
    with warnings.catch_warnings():
        warnings.resetwarnings()
        with fits.open(
            filename,
            do_not_scale_image_data=True,
            checksum=OPTIONS.checksum_kind,
            mode="update",
        ) as hdulist:
            hdulist.flush(output_verify=output_verify)