code: def _wrap_function(name, func):
      options_class = _get_options_class(func)
      arg_names = _get_arg_names(func)
      has_vararg = arg_names and arg_names[-1].startswith("*")
      if has_vararg:
          var_arg_names = [arg_names.pop().lstrip("*")]
      else:
          var_arg_names = []
  
      wrapper = _make_generic_wrapper(
          name, func, options_class, arity=func.arity
      )
      wrapper.__signature__ = _make_signature(
          arg_names, var_arg_names, options_class
      )
      return _decorate_compute_function(
          wrapper, name, func, options_class
      )
  
imports: from pyarrow._compute import Function, FunctionOptions, FunctionRegistry, HashAggregateFunction, HashAggregateKernel, Kernel, ScalarAggregateFunction, ScalarAggregateKernel, ScalarFunction, ScalarKernel, VectorFunction, VectorKernel, ArraySortOptions, AssumeTimezoneOptions, CastOptions, CountOptions, CumulativeOptions, CumulativeSumOptions, DayOfWeekOptions, DictionaryEncodeOptions, RunEndEncodeOptions, ElementWiseAggregateOptions, ExtractRegexOptions, FilterOptions, IndexOptions, JoinOptions, ListSliceOptions, MakeStructOptions, MapLookupOptions, MatchSubstringOptions, ModeOptions, NullOptions, PadOptions, PairwiseOptions, PartitionNthOptions, QuantileOptions, RandomOptions, RankOptions, ReplaceSliceOptions, ReplaceSubstringOptions, RoundBinaryOptions, RoundOptions, RoundTemporalOptions, RoundToMultipleOptions, ScalarAggregateOptions, SelectKOptions, SetLookupOptions, SliceOptions, SortOptions, SplitOptions, SplitPatternOptions, StrftimeOptions, StrptimeOptions, StructFieldOptions, TakeOptions, TDigestOptions, TrimOptions, Utf8NormalizeOptions, VarianceOptions, WeekOptions, call_function, function_registry, get_function, list_functions, call_tabular_function, register_scalar_function, register_tabular_function, register_aggregate_function, register_vector_function, UdfContext, Expression
  from collections import namedtuple
  import inspect
  from textwrap import dedent
  import warnings
  import pyarrow
  from pyarrow import _compute_docstrings
  from pyarrow.vendored import docscrape
label_desc: Use image node_id 8 for calling a global function with example usage: _wrap_function(name, func) and returns: _decorate_compute_function