code: def test_log_checks(self):
      # Test logging, fixing, errors for header checking
      HC = self.header_class
      # magic
      hdr = HC()
      with suppress_warnings():
          hdr["sizeof_hdr"] = 350  # severity 30
          fhdr, message, raiser = self.log_chk(hdr, 30)
  
      assert fhdr["sizeof_hdr"] == self.sizeof_hdr
      assert (
          message == f"sizeof_hdr should be {self.sizeof_hdr}; "
          f"set sizeof_hdr to {self.sizeof_hdr}"
      )
      pytest.raises(*raiser)
      # RGB datatype does not raise error
      hdr = HC()
      hdr.set_data_dtype("RGB")
      fhdr, message, raiser = self.log_chk(hdr, 0)
      # datatype not recognized
      hdr = HC()
      hdr["datatype"] = -1  # severity 40
      with suppress_warnings():
          fhdr, message, raiser = self.log_chk(hdr, 40)
      assert (
          message == "data code -1 not recognized; not attempting fix"
      )
  
      pytest.raises(*raiser)
      # datatype not supported
      hdr["datatype"] = 255  # severity 40
      fhdr, message, raiser = self.log_chk(hdr, 40)
      assert (
          message == "data code 255 not supported; not attempting fix"
      )
      pytest.raises(*raiser)
      # bitpix
      hdr = HC()
      hdr["datatype"] = 16  # float32
      hdr["bitpix"] = 16  # severity 10
      fhdr, message, raiser = self.log_chk(hdr, 10)
      assert fhdr["bitpix"] == 32
      assert (
          message
          == "bitpix does not match datatype; setting bitpix to match datatype"
      )
      pytest.raises(*raiser)
  
imports: import itertools
  import logging
  import os
  import pickle
  import re
  from io import BytesIO, StringIO
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from ..None import imageglobals
  from ..analyze import AnalyzeHeader, AnalyzeImage
  from ..arraywriters import WriterError
  from ..casting import sctypes_aliases
  from ..nifti1 import Nifti1Header
  from ..optpkg import optional_package
  from ..spatialimages import HeaderDataError, HeaderTypeError, supported_np_types
  from ..testing import assert_dt_equal, bytesio_filemap, bytesio_round_trip, data_path, suppress_warnings
  from ..tmpdirs import InTemporaryDirectory
  from .None import test_spatialimages
  from .None import test_wrapstruct
label_desc: Use image node_id 9 for calling the TestAnalyzeHeader obj's underlying member method code with example usage: obj.test_log_checks() without return types