code: def test_serializing_udfs():
      # Note, UDF in this context means a function that is not
      # recognized by Substrait.  It might still be a builtin pyarrow
      # function.
      schema = pa.schema([pa.field("x", pa.uint32())])
      a = pc.scalar(10)
      b = pc.scalar(4)
      exprs = [pc.shift_left(a, b)]
  
      with pytest.raises(ArrowNotImplementedError):
          pa.substrait.serialize_expressions(exprs, ["expr"], schema)
  
      buf = pa.substrait.serialize_expressions(
          exprs, ["expr"], schema, allow_arrow_extensions=True
      )
      returned = pa.substrait.deserialize_expressions(buf)
      assert schema == returned.schema
      assert len(returned.expressions) == 1
      assert str(returned.expressions["expr"]) == str(exprs[0])
  
imports: import os
  import pathlib
  import pytest
  import pyarrow
  import pyarrow.compute
  from pyarrow.lib import tobytes
  from pyarrow.lib import ArrowInvalid, ArrowNotImplementedError
label_desc: Use image node_id 21 for calling a global function with example usage: test_serializing_udfs() without return types