code: def test_both():
      # this should always work
      c = ct.AltConstraints(
          ct.Constraints(
              ct.EnsureFloat(), ct.EnsureRange(min=7.0, max=44.0)
          ),
          ct.EnsureNone(),
      )
      assert_equal(c(7.0), 7.0)
      assert_equal(c(None), None)
      # this should always fail
      assert_raises(ValueError, lambda: c(77.0))
  
file_path: datalad/datalad/tests/test_constraints.py
imports: from datalad.tests.utils_pytest import assert_equal, assert_raises
  from ..support import constraints
label_desc: Use image node_id 15 for calling a global function with example usage: test_both() without return types