code: def test_wrap():
      start, direction = np.array([0.1, 0.89]), np.array([0.2, 0.1])
      wrap = np.array([False, False])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.1, 0.89])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 1.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.3, 0.99])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 2.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.5, 0.91])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 3.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.7, 0.81])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 4.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.9, 0.71])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 5.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.9, 0.61])
  
      start, direction = np.array([0.1, 0.89]), np.array([0.2, 0.1])
      wrap = np.array([True, False])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.1, 0.89])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 1.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.3, 0.99])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 2.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.5, 0.91])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 3.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.7, 0.81])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 4.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.9, 0.71])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 5.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.1, 0.61])
  
      start, direction = np.array([0.1, 0.89]), np.array([0.2, 0.1])
      wrap = np.array([False, True])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.1, 0.89])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 1.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.3, 0.99])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 2.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.5, 0.09])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 3.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.7, 0.19])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 4.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.9, 0.29])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 5.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.9, 0.39])
  
      start, direction = np.array([0.1, 0.89]), np.array([0.2, 0.1])
      wrap = np.array([True, True])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.1, 0.89])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 1.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.3, 0.99])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 2.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.5, 0.09])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 3.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.7, 0.19])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 4.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.9, 0.29])
      newpoint, _ = linear_steps_with_reflection(
          start, direction, 5.0, wrapped_dims=wrap
      )
      assert_allclose(newpoint, [0.1, 0.39])
  
file_path: ultranest/tests/test_samplingpath.py
imports: import numpy
  import matplotlib.pyplot
  from ultranest.mlfriends import AffineLayer, MLFriends
  from ultranest.samplingpath import SamplingPath, ContourSamplingPath
  from ultranest.samplingpath import box_line_intersection, nearest_box_intersection_line, linear_steps_with_reflection, angle, get_sphere_tangents, norm
  from numpy.testing import assert_allclose
label_desc: Use image node_id 3 for calling a global function with example usage: test_wrap() without return types