code: def test_slope_inter(self):
      hdr = self.header_class()
      assert hdr.get_slope_inter() == (1.0, 0.0)
      for in_tup, exp_err, out_tup, raw_slope in (
          ((2.0,), None, (2.0, 0.0), 2.0),
          ((None,), None, (None, None), np.nan),
          ((1.0, None), None, (1.0, 0.0), 1.0),
          # non zero intercept causes error
          ((None, 1.1), HeaderTypeError, (None, None), np.nan),
          ((2.0, 1.1), HeaderTypeError, (None, None), 2.0),
          # null scalings
          ((0.0, None), HeaderDataError, (None, None), 0.0),
          ((np.nan, np.nan), None, (None, None), np.nan),
          ((np.nan, None), None, (None, None), np.nan),
          ((None, np.nan), None, (None, None), np.nan),
          ((np.inf, None), HeaderDataError, (None, None), np.inf),
          ((-np.inf, None), HeaderDataError, (None, None), -np.inf),
          ((None, 0.0), None, (None, None), np.nan),
      ):
          hdr = self.header_class()
          if not exp_err is None:
              with pytest.raises(exp_err):
                  hdr.set_slope_inter(*in_tup)
              # raw set
              if not in_tup[0] is None:
                  hdr["scl_slope"] = in_tup[0]
          else:
              hdr.set_slope_inter(*in_tup)
              assert hdr.get_slope_inter() == out_tup
              # Check set survives through checking
              hdr = Spm2AnalyzeHeader.from_header(hdr, check=True)
              assert hdr.get_slope_inter() == out_tup
          assert_array_equal(hdr["scl_slope"], raw_slope)
  
file_path: nibabel/nibabel/tests/test_spm2analyze.py
imports: import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from ..spatialimages import HeaderDataError, HeaderTypeError
  from ..spm2analyze import Spm2AnalyzeHeader, Spm2AnalyzeImage
  from .None import test_spm99analyze
label_desc: Use image node_id 1 for calling the TestSpm2AnalyzeHeader obj's underlying member method code with example usage: obj.test_slope_inter() without return types