code: def test_clean_points():
      """Test on a set of points."""
      n_unique_points = 100
      u_points = np.random.default_rng().random((n_unique_points, 3))
      points = np.vstack([u_points] * 2)
  
      grid = pv.PolyData(points).cast_to_unstructured_grid()
      grid.point_data["data"] = np.hstack(
          (np.zeros(n_unique_points), np.ones(n_unique_points))
      )
  
      cleaned = grid.clean(produce_merge_map=True)
      assert cleaned.field_data["PointMergeMap"].size == points.shape[0]
      assert cleaned.n_points == n_unique_points
      assert np.allclose(cleaned.point_data["data"], 0.5)
      assert cleaned.point_data["data"].size == n_unique_points
  
      # verify not averaging works
      cleaned = grid.clean(average_point_data=False)
      assert cleaned.n_points == n_unique_points
      assert not (cleaned.point_data["data"] == 0.5).any()
  
      # verify tolerance
      u_points = np.random.default_rng().random((n_unique_points, 3))
      u_points_shift = u_points.copy()
      u_points_shift[:, 2] += 1e-4
      points = np.vstack((u_points, u_points_shift))
  
      grid = pv.PolyData(points).cast_to_unstructured_grid()
      cleaned = grid.clean(tolerance=1e-5)
      assert cleaned.n_points == points.shape[0]
  
imports: import numpy
  import pytest
  import pyvista
label_desc: Use image node_id 1 for calling a global function with example usage: test_clean_points() without return types