code: def test_buffer_creation_from_any():
      ary = cp.arange(arr_len)
      b = as_buffer(ary, exposed=True)
      assert isinstance(b, Buffer)
      assert ary.data.ptr == b.get_ptr(mode="read")
      assert ary.nbytes == b.size
  
      with pytest.raises(
          ValueError,
          match="size must be specified when `data` is an integer",
      ):
          as_buffer(ary.data.ptr)
  
      b = as_buffer(
          ary.data.ptr, size=ary.nbytes, owner=ary, exposed=True
      )
      assert isinstance(b, Buffer)
      assert ary.data.ptr == b.get_ptr(mode="read")
      assert ary.nbytes == b.size
      assert b.owner.owner.owner is ary
  
file_path: cudf/python/cudf/cudf/tests/test_buffer.py
imports: import cupy
  import pytest
  from cudf.core.buffer import Buffer, as_buffer
label_desc: Use image node_id 3 for calling a global function with example usage: test_buffer_creation_from_any() without return types