code: def test_resets():
      # Test reset of values, caching of scales
      for klass, inp, outp in (
          (SlopeInterArrayWriter, (1, 511), (2.0, 1.0)),
          (SlopeArrayWriter, (0, 510), (2.0, 0.0)),
      ):
          arr = np.array(inp)
          outp = np.array(outp)
          aw = klass(arr, np.uint8)
          assert_array_equal(get_slope_inter(aw), outp)
          aw.calc_scale()  # cached no change
          assert_array_equal(get_slope_inter(aw), outp)
          aw.calc_scale(force=True)  # same data, no change
          assert_array_equal(get_slope_inter(aw), outp)
          # Change underlying array
          aw.array[:] = aw.array * 2
          aw.calc_scale()  # cached still
          assert_array_equal(get_slope_inter(aw), outp)
          aw.calc_scale(force=True)  # new data, change
          assert_array_equal(get_slope_inter(aw), outp * 2)
          # Test reset
          aw.reset()
          assert_array_equal(get_slope_inter(aw), (1.0, 0.0))
  
imports: import itertools
  from io import BytesIO
  from platform import machine, python_compiler
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from ..arraywriters import ArrayWriter, ScalingError, SlopeArrayWriter, SlopeInterArrayWriter, WriterError, get_slope_inter, make_array_writer
  from ..casting import int_abs, sctypes, shared_range, type_info
  from ..testing import assert_allclose_safely, suppress_warnings
  from ..volumeutils import _dt_min_max, apply_read_scaling, array_from_file
label_desc: Use image node_id 10 for calling a global function with example usage: test_resets() without return types