code: def index(data, value, start=None, end=None, *, memory_pool=None):
      """
      Find the index of the first occurrence of a given value.
  
      Parameters
      ----------
      data : Array-like
      value : Scalar-like object
          The value to search for.
      start : int, optional
      end : int, optional
      memory_pool : MemoryPool, optional
          If not passed, will allocate memory from the default memory pool.
  
      Returns
      -------
      index : int
          the index, or -1 if not found
      """
      if start is not None:
          if end is not None:
              data = data.slice(start, end - start)
          else:
              data = data.slice(start)
      elif end is not None:
          data = data.slice(0, end)
  
      if not isinstance(value, pa.Scalar):
          value = pa.scalar(value, type=data.type)
      elif data.type != value.type:
          value = pa.scalar(value.as_py(), type=data.type)
      options = IndexOptions(value=value)
      result = call_function("index", [data], options, memory_pool)
      if start is not None and result.as_py() >= 0:
          result = pa.scalar(result.as_py() + start, type=pa.int64())
      return result
  
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 11 for calling a global function with example usage: index(data, value, start, end) and returns: result