code: def _monotonic_chunk(x, prop):
      if x.empty:
          # if input is empty, return empty df for chunk
          data = None
      else:
          data = x if is_index_like(x) else x.iloc
          data = [[getattr(x, prop), data[0], data[-1]]]
      return pd.DataFrame(
          data=data, columns=["monotonic", "first", "last"]
      )
  
imports: from __future__ import annotations
  import warnings
  from functools import partial
  import numpy
  import pandas
  from pandas.api.types import is_extension_array_dtype
  from pandas.errors import PerformanceWarning
  from tlz import partition
  from dask.dataframe._compat import PANDAS_GE_131, PANDAS_GE_140, PANDAS_GE_200, check_apply_dataframe_deprecation, check_applymap_dataframe_deprecation, check_convert_dtype_deprecation, check_observed_deprecation
  from dask.dataframe.dispatch import concat, concat_dispatch, group_split_dispatch, hash_object_dispatch, is_categorical_dtype, is_categorical_dtype_dispatch, tolist, tolist_dispatch, union_categoricals
  from dask.dataframe.utils import is_dataframe_like, is_index_like, is_series_like
label_desc: Use image node_id 39 for calling a global function with example usage: _monotonic_chunk(x, prop) and returns: pd