class_docstr: Base class that is inherited by the majority of classes in River.
  
  This base class allows us to handle the following tasks in a uniform manner:
  
  - Getting and setting parameters
  - Displaying information
  - Mutating/cloning
docstr: Return the memory usage in bytes.
docstr_tok: ["Return","the","memory","usage","in","bytes","."]
code: def _raw_memory_usage(self) -> int:
      """Return the memory usage in bytes."""
  
      import numpy as np
  
      buffer = collections.deque([self])
      seen = set()
      size = 0
      while len(buffer) > 0:
          obj = buffer.popleft()
          obj_id = id(obj)
          if obj_id in seen:
              continue
          size += sys.getsizeof(obj)
          # Important mark as seen to gracefully handle self-referential objects
          seen.add(obj_id)
          if isinstance(obj, dict):
              buffer.extend([k for k in obj.keys()])
              buffer.extend([v for v in obj.values()])
          elif hasattr(obj, "__dict__"):  # Save object contents
              contents: dict = vars(obj)
              size += sys.getsizeof(contents)
              buffer.extend([k for k in contents.keys()])
              buffer.extend([v for v in contents.values()])
          elif isinstance(obj, np.ndarray):
              size += obj.nbytes
          elif (
              isinstance(obj, itertools.count)
              or isinstance(obj, itertools.cycle)
              or isinstance(obj, itertools.repeat)
          ):
              ...
          elif hasattr(obj, "__iter__") and not (
              isinstance(obj, str)
              or isinstance(obj, bytes)
              or isinstance(obj, bytearray)
          ):
              buffer.extend([i for i in obj])  # type: ignore
  
      return size
  
imports: from __future__ import annotations
  import collections
  import contextlib
  import copy
  import inspect
  import itertools
  import logging
  import sys
  import types
  import typing
label_desc: Use image node_id 9 for calling the Base obj's underlying member method code with example usage: obj._raw_memory_usage() and returns: size