code: def bucket(
      numBuckets: Union[Column, int], col: "ColumnOrName"
  ) -> Column:
      if isinstance(numBuckets, int):
          _numBuckets = lit(numBuckets)
      elif isinstance(numBuckets, Column):
          _numBuckets = numBuckets
      else:
          raise PySparkTypeError(
              error_class="NOT_COLUMN_OR_INT",
              message_parameters={
                  "arg_name": "numBuckets",
                  "arg_type": type(numBuckets).__name__,
              },
          )
  
      return _invoke_function("bucket", _numBuckets, _to_col(col))
  
file_path: spark/python/pyspark/sql/connect/functions/partitioning.py
imports: from pyspark.sql.connect.utils import check_dependencies
  from typing import Union, TYPE_CHECKING
  from pyspark.errors import PySparkTypeError
  from pyspark.sql import functions
  from pyspark.sql.connect.column import Column
  from pyspark.sql.connect.functions.builtin import _to_col, _invoke_function_over_columns
  from pyspark.sql.connect.functions.builtin import lit, _invoke_function
label_desc: Use image node_id 1 for calling a global function with example usage: bucket(numBuckets, col) and returns: _invoke_function