code: def test_from_records_withindex(columns):
      recdtype = np.dtype(
          [("index", np.int64), ("a", np.int32), ("b", np.float64)]
      )
      rec = np.recarray(10, dtype=recdtype)
      rec.index = ii = np.arange(30, 40)
      rec.a = aa = np.arange(10, dtype=np.int32)
      rec.b = bb = np.arange(10, 20, dtype=np.float64)
      df = DataFrame.from_records(rec, index="index")
  
      if columns and "a" in columns:
          assert_eq(aa, df["a"].values)
      if columns and "b" in columns:
          assert_eq(bb, df["b"].values)
      assert_eq(ii, df.index.values)
  
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 4 for calling a global function with example usage: test_from_records_withindex(columns) without return types