code: def test_discrete():
      @discrete([1.0, 3.5, 5.5, 7.0])
      def discrete_squared(x):
          return x**2
  
      from numpy import asarray
  
      assert discrete_squared(5.6) == 5.5**2
      assert all(
          discrete_squared(asarray([1, 3])) == asarray([1.0, 3.5]) ** 2
      )
      discrete_squared.samples([1.0, 7.0])
      assert discrete_squared(5.6) == 7.0**2
      discrete_squared.index([0, -1])
      assert all(
          discrete_squared(asarray([0, 3, 6]))
          == asarray([1.0, 3.0, 7.0]) ** 2
      )
  
file_path: mystic/mystic/tests/test_constraints.py
imports: from mystic.constraints import *
  from mystic.penalty import quadratic_equality
  from mystic.coupler import inner
  from mystic.math import almostEqual
  from mystic.tools import random_seed
label_desc: Use image node_id 11 for calling a global function with example usage: test_discrete() and returns: unknown