code: def test_unroll_scan():
      from lasagne.utils import unroll_scan
  
      k = 2
      a = T.scalar("a")
  
      result = unroll_scan(
          fn=lambda step, prior_result, a: prior_result * a,
          sequences=T.arange(k),
          outputs_info=[1.0],
          non_sequences=[a],
          n_steps=k,
      )
      final_result = result[-1]
      power = theano.function(inputs=[a], outputs=final_result)
  
      assert np.all(power(10) == [10, 100])
  
      b = T.scalar("b")
  
      def mul_div(step, previous_mul, previous_div, mul, div):
          return previous_mul * mul, previous_div / div
  
      result = unroll_scan(
          fn=mul_div,
          sequences=T.arange(k),
          outputs_info=[1.0, 1.0],
          non_sequences=[a, b],
          n_steps=k,
      )
      power = theano.function(inputs=[a, b], outputs=result)
      assert np.allclose(power(10, 10), [[10, 100], [0.1, 0.01]])
  
imports: from mock import Mock
  import pytest
  import numpy
  import theano
  import theano.tensor
label_desc: Use image node_id 30 for calling a global function with example usage: test_unroll_scan() and returns: unknown,  unknown