code: def test_remote_function(setup):
      session = setup
  
      def f1(x):
          return x + 1
  
      def f2(x, y, z=None):
          return x * y * (z[0] + z[1])
  
      rs = np.random.RandomState(0)
      raw1 = rs.rand(10, 10)
      raw2 = rs.rand(10, 10)
  
      r1 = spawn(f1, raw1)
      r2 = spawn(f1, raw2)
      r3 = spawn(f2, (r1, r2), {"z": [r1, r2]})
  
      result = r3.execute().fetch()
      expected = (raw1 + 1) * (raw2 + 1) * (raw1 + 1 + raw2 + 1)
      np.testing.assert_almost_equal(result, expected)
  
      with pytest.raises(TypeError):
          spawn(f2, (r1, r2), kwargs=())
  
      with pytest.raises(ValueError, match="Unexpected kw: k"):
          spawn(f2, (r1, r2), k=1)
  
      session_id = session.session_id
  
      def f():
          assert get_default_session().session_id == session_id
          return mt.ones((2, 3)).sum().to_numpy()
  
      assert spawn(f).execute().fetch() == 6
  
imports: from collections import defaultdict
  import numpy
  import pandas
  import pytest
  from ...None import dataframe
  from ...None import get_context
  from ...None import oscar
  from ...None import tensor
  from ...core import tile
  from ...session import get_default_session
  from ...learn.utils import shuffle
  from ...lib.mmh3 import hash
  from ..None import spawn, ExecutableTuple
label_desc: Use image node_id 2 for calling a global function with example usage: test_remote_function(setup) and returns: unknown, unknown, mt