code: def test_lookup():
      Q1 = [
          np.array(q, np.bool_)
          for q in (
              [[0, 0], [1, 0]],
              [[0, 0], [0, 1]],
              [[0, 1], [0, 0]],
              [[1, 0], [0, 0]],
          )
      ]
      Q2 = [(~q) for q in Q1]
      Q3 = [
          np.array(q, np.bool_)
          for q in ([[0, 1], [1, 0]], [[1, 0], [0, 1]])
      ]
  
      def _value(q, lookup):
          q = q.ravel()
          value = np.dot(q, (1, 2, 4, 8))
          return lookup[value]
  
      for q in Q1:
          assert _value(q, _euler_lookup8) == 0.25
          assert _value(q, _euler_lookup4) == 0.25
      for q in Q2:
          assert _value(q, _euler_lookup8) == -0.25
          assert _value(q, _euler_lookup4) == -0.25
      for q in Q3:
          assert _value(q, _euler_lookup8) == -0.5
          assert _value(q, _euler_lookup4) == 0.5
  
imports: import numpy
  from mahotas.euler import euler, _euler_lookup4, _euler_lookup8
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_lookup() and returns: lookup