class_docstr: Efficiently estimates the Ray serialized size of a stream of items.
  
  For efficiency, this only samples a fraction of the added items for real
  Ray-serialization.
class_docstr_tok: ["Efficiently","estimates","the","Ray","serialized","size","of","a","stream","of","items",".","For","efficiency",",","this","only","samples","a","fraction","of","the","added","items","for","real","Ray-serialization","."]
code: def add_block(self, block: List[Any]) -> None:
      if self._count < 10:
          for i in range(min(10 - self._count, len(block))):
              self._running_mean.add(
                  self._real_size(block[i]), weight=1
              )
      if self._count < 100:
          for i in range(
              10 - (self._count % 10),
              min(100 - self._count, len(block)),
              10,
          ):
              self._running_mean.add(
                  self._real_size(block[i]), weight=10
              )
      if (len(block) + (self._count % 100)) // 100 > 1:
          for i in range(100 - (self._count % 100), len(block), 100):
              self._running_mean.add(
                  self._real_size(block[i]), weight=100
              )
      self._count += len(block)
  
file_path: ray/python/ray/data/_internal/size_estimator.py
imports: from typing import Any, List
  import ray
  from ray import cloudpickle
label_desc: Use image node_id 3 for calling the SizeEstimator obj's underlying member method code with example usage: obj.add_block(block) without return types