class_docstr: Generic GPU buffer.
  
  A generic buffer is an interface used to upload data to a GPU array buffer
  (ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER). It keeps track of
  buffer size but does not have any CPU storage. You can consider it as
  write-only.
  
  The `set_data` is a deferred operation: you can call it even if an OpenGL
  context is not available. The `update` function is responsible to upload
  pending data to GPU memory and requires an active GL context.
  
  The Buffer class only deals with data in terms of bytes; it is not
  aware of data type or element size.
  
  Parameters
  ----------
  data : ndarray | None
      Buffer data.
  nbytes : int | None
      Buffer byte size.
class_docstr_tok: ["Generic","GPU","buffer",".","A","generic","buffer","is","an","interface","used","to","upload","data","to","a","GPU","array","buffer","(","ARRAY_BUFFER","or","ELEMENT_ARRAY_BUFFER",")",".","It","keeps","track","of","buffer","size","but","does","not","have","any","CPU","storage",".","You","can","consider","it","as","write-only",".","The","`","set_data","`","is","a","deferred","operation",":","you","can","call","it","even","if","an","OpenGL","context","is","not","available",".","The","`","update","`","function","is","responsible","to","upload","pending","data","to","GPU","memory","and","requires","an","active","GL","context",".","The","Buffer","class","only","deals","with","data","in","terms","of","bytes",";","it","is","not","aware","of","data","type","or","element","size",".","Parameters","--","--","--","--","--","data",":","ndarray","|","None","Buffer","data",".","nbytes",":","int","|","None","Buffer","byte","size","."]
docstr: Resize this buffer (deferred operation).
  
  Parameters
  ----------
  size : int
      New buffer size in bytes.
code: def resize_bytes(self, size):
      """Resize this buffer (deferred operation).
  
      Parameters
      ----------
      size : int
          New buffer size in bytes.
      """
      self._nbytes = size
      self._glir.command("SIZE", self._id, size)
      # Invalidate any view on this buffer
      for view in self._views:
          view._valid = False
      self._views = weakref.WeakSet()
  
imports: import numpy
  from os import path
  from traceback import extract_stack, format_list
  import weakref
  from .globject import GLObject
  from ..util import logger
label_desc: Use image node_id 5 for calling the Buffer obj's underlying member method code with example usage: obj.resize_bytes(size) without return types