code: def test_factorize_series_index():
      df = DataFrame()
      df["col1"] = ["C", "H", "C", "W", "W", "W", "W", "W", "C", "W"]
      df["col2"] = [
          2992443.0,
          2992447.0,
          2992466.0,
          2992440.0,
          2992441.0,
          2992442.0,
          2992444.0,
          2992445.0,
          2992446.0,
          2992448.0,
      ]
      assert_eq(
          df.col1.factorize()[0].get(),
          df.to_pandas().col1.factorize()[0],
      )
      assert_eq(
          df.col1.factorize()[1].to_pandas().values,
          df.to_pandas().col1.factorize()[1].values,
      )
  
      df = df.set_index("col2")
  
      assert_eq(
          df.col1.factorize()[0].get(),
          df.to_pandas().col1.factorize()[0],
      )
      assert_eq(
          df.col1.factorize()[1].to_pandas().values,
          df.to_pandas().col1.factorize()[1].values,
      )
  
file_path: cudf/python/cudf/cudf/tests/test_factorize.py
imports: import cupy
  import numpy
  import pandas
  import pytest
  import cudf
  from cudf import DataFrame, Index
  from cudf.testing._utils import assert_eq
label_desc: Use image node_id 3 for calling a global function with example usage: test_factorize_series_index() without return types