code: def test_to_records_withindex():
      df = DataFrame()
      df["a"] = aa = np.arange(10, dtype=np.int32)
      df["b"] = bb = np.arange(10, 20, dtype=np.float64)
  
      rec_indexed = df.to_records(index=True)
      assert rec_indexed.size == len(aa)
      assert rec_indexed.dtype.names == ("index", "a", "b")
      np.testing.assert_array_equal(rec_indexed["a"], aa)
      np.testing.assert_array_equal(rec_indexed["b"], bb)
      np.testing.assert_array_equal(rec_indexed["index"], np.arange(10))
  
file_path: cudf/python/cudf/cudf/tests/test_numpy_interop.py
imports: import numpy
  import pytest
  from cudf import DataFrame, Series
  from cudf.testing._utils import assert_eq
label_desc: Use image node_id 2 for calling a global function with example usage: test_to_records_withindex() without return types