class_docstr: Data in the buffer is guaranteed to be contiguous in memory.
class_docstr_tok: ["Data","in","the","buffer","is","guaranteed","to","be","contiguous","in","memory","."]
docstr: Handle only regular columns (= numpy arrays) for now.
docstr_tok: ["Handle","only","regular","columns","(","=","numpy","arrays",")","for","now","."]
code: def __init__(self, x: np.ndarray, allow_copy: bool = True) -> None:
      """
      Handle only regular columns (= numpy arrays) for now.
      """
      if not x.strides == (x.dtype.itemsize,):
          # The protocol does not support strided buffers, so a copy is
          # necessary. If that's not allowed, we need to raise an exception.
          if allow_copy:
              x = x.copy()
          else:
              raise RuntimeError(
                  "Exports cannot be zero-copy in the case "
                  "of a non-contiguous buffer"
              )
  
      # Store the numpy array in which the data resides as a private
      # attribute, so we can use it to retrieve the public attributes
      self._x = x
  
file_path: catboost/contrib/python/pandas/py3/pandas/core/interchange/buffer.py
imports: from __future__ import annotations
  import numpy
  from pandas.core.interchange.dataframe_protocol import Buffer, DlpackDeviceType
  from pandas.util.version import Version
label_desc: Use image node_id 1 to create a new PandasBuffer object from inherited base classes: Buffer with example: obj = PandasBuffer(x, allow_copy)