code: def test_pysr_luts(data):
      try:
          from pysr import PySRRegressor
      except ImportError:
          pytest.skip("Failed to import PySR, test will be skipped.")
  
      function_definitions = [
          "cos_lut(x) = math_lut(cos, x, N=1024, range_start=-4, range_end=4)"
      ]
      hls4ml.utils.symbolic_utils.init_pysr_lut_functions(
          init_defaults=True, function_definitions=function_definitions
      )
  
      model = PySRRegressor(
          model_selection="best",  # Result is mix of simplicity+accuracy
          niterations=10,
          binary_operators=["+", "*"],
          unary_operators=[
              "cos_lut",
          ],
          loss="loss(x, y) = (x - y)^2",
          temp_equation_file=True,
      )
  
      X, y = data
  
      model.fit(X, y)
  
      eq = str(model.sympy())
  
      assert "cos_lut" in eq
  
imports: from pathlib import Path
  import numpy
  import pytest
  import hls4ml
label_desc: Use image node_id 3 for calling a global function with example usage: test_pysr_luts(data) without return types