code: def assert_chf_properties(chf):
      if not np.isfinite(chf).all():
          raise AssertionError(
              "chf contains values that are not finite"
          )
      if np.any(chf < 0.0):
          raise AssertionError("chf contains negative values")
  
      d = np.apply_along_axis(np.diff, 1, chf)
      if np.any(d < 0):
          raise AssertionError("chf are not monotonically increasing")
  
      # chf at first time point
      num_closer_to_one = np.sum(1.0 - chf[:, 0] < chf[:, 0])
      if num_closer_to_one / chf.shape[0] > 0.5:
          raise AssertionError(
              f"most ({num_closer_to_one}) hazard rates at first time point are closer to 1 than 0"
          )
  
file_path: scikit-survival/sksurv/testing.py
imports: from importlib import import_module
  import inspect
  from pathlib import Path
  import pkgutil
  import numpy
  from numpy.testing import assert_almost_equal, assert_array_equal
  import pytest
  import sksurv
  from sksurv.base import SurvivalAnalysisMixin
  from sksurv.metrics import concordance_index_censored
label_desc: Use image node_id 3 for calling a global function with example usage: assert_chf_properties(chf) without return types