code: def test_median_smoothing(self):
      data = []
      for i in range(10):
          data.extend(np.arange(0, 8))
          data.extend(np.arange(1, 9)[::-1])
      should_stop = check_should_stop(
          mode="median_smoothing",
          performance_history=np.arange(0, 20) / 10.0,
      )
      self.assertTrue(should_stop)
      should_stop = check_should_stop(
          mode="median_smoothing",
          performance_history=np.arange(0, 20)[::-1] / 10,
      )
      self.assertFalse(should_stop)
  
      should_stop = check_should_stop(
          mode="median_smoothing", performance_history=data
      )
      self.assertFalse(should_stop)
  
file_path: NiftyNet/tests/handler_early_stopping_test.py
imports: from __future__ import absolute_import, print_function
  import tensorflow
  import numpy
  from niftynet.engine.handler_early_stopping import check_should_stop
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 6 for calling the EarlyStopperTest obj's underlying member method code with example usage: obj.test_median_smoothing() without return types