code: def get_ptr_and_size(array_interface: Mapping) -> Tuple[int, int]:
      """Retrieve the pointer and size from an array interface.
  
      Raises ValueError if array isn't C-contiguous.
  
      Parameters
      ----------
      array_interface : Mapping
          The array interface metadata.
  
      Return
      ------
      pointer : int
          The pointer to device or host memory
      size : int
          The size in bytes
      """
  
      shape = array_interface["shape"] or (1,)
      strides = array_interface["strides"]
      itemsize = cudf.dtype(array_interface["typestr"]).itemsize
      if strides is None or is_c_contiguous(shape, strides, itemsize):
          nelem = math.prod(shape)
          ptr = array_interface["data"][0] or 0
          return ptr, nelem * itemsize
      raise ValueError("Buffer data must be C-contiguous")
  
imports: from __future__ import annotations
  import math
  import pickle
  import weakref
  from types import SimpleNamespace
  from typing import Any, Dict, Literal, Mapping, Optional, Sequence, Tuple
  import numpy
  from typing_extensions import Self
  import rmm
  import cudf
  from cudf.core.abc import Serializable
  from cudf.utils.string import format_bytes
label_desc: Use image node_id 4 for calling a global function with example usage: get_ptr_and_size(array_interface) and returns: ptr,  unknown