code: def check_pandas_udf_result(f, *input_args):
      output = f(*input_args)
      import pandas as pd
  
      assert (
          type(output) == pd.Series or type(output) == pd.DataFrame
      ), (
          "The result type of Pandas UDF '%s' must be pandas.Series or pandas.DataFrame, got %s"
          % (f.__name__, type(output))
      )
      assert len(output) == len(input_args[0]), (
          "The result length '%d' of Pandas UDF '%s' is not equal to the input length '%d'"
          % (len(output), f.__name__, len(input_args[0]))
      )
      return output
  
imports: import datetime
  import threading
  import time
  from collections.abc import Generator
  from functools import partial
  from typing import Any, Tuple, Dict, List
  from pyflink.common import Row
  from pyflink.fn_execution import pickle
  from pyflink.serializers import PickleSerializer
  from pyflink.table import functions
  from pyflink.table.udf import DelegationTableFunction, DelegatingScalarFunction, ImperativeAggregateFunction, PandasAggregateFunctionWrapper
label_desc: Use image node_id 4 for calling a global function with example usage: check_pandas_udf_result(f) and returns: output