code: def test_to_dlpack_index(data_1d):
      expectation = data_size_expectation_builder(data_1d)
  
      with expectation:
          if np.isnan(data_1d).any():
              pytest.skip("Nulls not allowed in Index")
          gi = cudf.core.index.as_index(data_1d)
          dlt = gi.to_dlpack()
  
          # PyCapsules are a C-API thing so couldn't come up with a better way
          assert str(type(dlt)) == "<class 'PyCapsule'>"
  
imports: import itertools
  from contextlib import ExitStack
  import cupy
  import numpy
  import pytest
  from packaging import version
  import cudf
  from cudf.testing._utils import assert_eq
label_desc: Use image node_id 7 for calling a global function with example usage: test_to_dlpack_index(data_1d) without return types