code: def test_cut():
      s = from_pandas_series(
          pd.Series([1.0, 2.0, 3.0, 4.0]), chunk_size=2
      )
  
      with pytest.raises(ValueError):
          _ = cut(s, -1)
  
      with pytest.raises(ValueError):
          _ = cut([[1, 2], [3, 4]], 3)
  
      with pytest.raises(ValueError):
          _ = cut([], 3)
  
      r, b = cut(s, [1.5, 2.5], retbins=True)
      assert isinstance(r, SERIES_TYPE)
      assert isinstance(b, TENSOR_TYPE)
  
      r = tile(r)
  
      assert len(r.chunks) == 2
      for c in r.chunks:
          assert isinstance(c, SERIES_CHUNK_TYPE)
          assert c.shape == (2,)
  
      r = cut(s.to_tensor(), [1.5, 2.5])
      assert isinstance(r, CATEGORICAL_TYPE)
      assert len(r) == len(s)
      assert "Categorical" in repr(r)
  
      r = tile(r)
  
      assert len(r.chunks) == 2
      for c in r.chunks:
          assert isinstance(c, CATEGORICAL_CHUNK_TYPE)
          assert c.shape == (2,)
          assert c.ndim == 1
  
      r = cut([0, 1, 1, 2], bins=4, labels=False)
      assert isinstance(r, TENSOR_TYPE)
      e = pd.cut([0, 1, 1, 2], bins=4, labels=False)
      assert r.dtype == e.dtype
  
imports: from typing import List, Union
  import numpy
  import pandas
  import pytest
  from ....None import opcodes
  from ....config import options, option_context
  from ....core import OutputType, tile, Tileable
  from ....core.graph import TileableGraph, TileableGraphBuilder, TileContext, ChunkGraphBuilder
  from ....core.operand import OperandStage
  from ....tensor.core import TENSOR_TYPE
  from ...None import eval, cut, get_dummies, to_numeric
  from ...core import DATAFRAME_TYPE, SERIES_TYPE, SERIES_CHUNK_TYPE, INDEX_TYPE, CATEGORICAL_TYPE, CATEGORICAL_CHUNK_TYPE, DataFrameData, SeriesData
  from ...datasource.dataframe import from_pandas
  from ...datasource.series import from_pandas
  from ...datasource.index import from_pandas
  from ..None import to_gpu, to_cpu, astype
label_desc: Use image node_id 11 for calling a global function with example usage: test_cut() without return types