code: def test_threshold(pointset):
      pointset["scalars"] = range(pointset.n_points)
      out = pointset.threshold(pointset.n_points // 2)
      assert isinstance(out, pv.PointSet)
      assert out.n_points == pointset.n_points // 2
  
imports: import numpy
  import pytest
  import vtk
  import pyvista
  from pyvista.core.errors import PointSetCellOperationError, PointSetDimensionReductionError, PointSetNotSupported
label_desc: Use image node_id 17 for calling a global function with example usage: test_threshold(pointset) without return types