code: def digitize(
      column: ColumnBase, bins: np.ndarray, right: bool = False
  ) -> ColumnBase:
      """Return the indices of the bins to which each value in column belongs.
  
      Parameters
      ----------
      column : Column
          Input column.
      bins : Column-like
          1-D column-like object of bins with same type as `column`, should be
          monotonically increasing.
      right : bool
          Indicates whether interval contains the right or left bin edge.
  
      Returns
      -------
      A column containing the indices
      """
      if not column.dtype == bins.dtype:
          raise ValueError(
              "Digitize() expects bins and input column have the same dtype."
          )
  
      bin_col = as_column(bins, dtype=bins.dtype)
      if bin_col.nullable:
          raise ValueError("`bins` cannot contain null entries.")
  
      return as_column(
          libcudf.sort.digitize([column], [bin_col], right)
      )
  
imports: from __future__ import annotations
  from typing import Any, Callable, Mapping, Optional, Sequence, Tuple, Union, cast
  import cupy
  import numpy
  import pandas
  from typing_extensions import Self
  import cudf
  from cudf import _lib
  from cudf._lib.types import size_type_dtype
  from cudf._typing import ColumnBinaryOperand, ColumnLike, Dtype, DtypeObj, ScalarLike
  from cudf.api.types import is_bool_dtype, is_float_dtype, is_integer, is_integer_dtype, is_scalar
  from cudf.core.buffer import Buffer, cuda_array_interface_wrapper
  from cudf.core.column import ColumnBase, as_column, build_column, column, full, string
  from cudf.core.dtypes import CategoricalDtype
  from cudf.core.mixins import BinaryOperand
  from cudf.utils.dtypes import NUMERIC_TYPES, min_column_type, min_signed_type, np_dtypes_to_pandas_dtypes, numeric_normalize_types
  from .numerical_base import NumericalBaseColumn
label_desc: Use image node_id 2 for calling a global function with example usage: digitize(column, bins, right) and returns: as_column