code: def test_implemented_function():
      # Here we check if the default returned functions are anonymous - in
      # the sense that we can have more than one function with the same name
      f = implemented_function("f", lambda x: 2 * x)
      g = implemented_function("f", lambda x: np.sqrt(x))
      l1 = lambdify(x, f(x))
      l2 = lambdify(x, g(x))
      assert str(f(x)) == str(g(x))
      assert l1(3) == 6
      assert l2(3) == np.sqrt(3)
      # check that we can pass in a sympy function as input
      func = sympy.Function("myfunc")
      assert not hasattr(func, "_imp_")
      f = implemented_function(func, lambda x: 2 * x)
      assert hasattr(f, "_imp_")
  
file_path: nipy/nipy/modalities/fmri/tests/test_aliases.py
imports: import numpy
  import pytest
  import scipy.interpolate
  import sympy
  from numpy.testing import assert_almost_equal
  from sympy.utilities.lambdify import implemented_function, lambdify
label_desc: Use image node_id 1 for calling a global function with example usage: test_implemented_function() without return types