class_docstr: A BlockList that submits tasks lazily on-demand.
  
  This BlockList is used for implementing read operations (e.g., to avoid
  needing to read all files of a Dataset when the user is just wanting to
  .take() the first few rows or view the schema).
class_docstr_tok: ["A","BlockList","that","submits","tasks","lazily","on-demand",".","This","BlockList","is","used","for","implementing","read","operations","(","e.g.",",","to","avoid","needing","to","read","all","files","of","a","Dataset","when","the","user","is","just","wanting","to",".take","(",")","the","first","few","rows","or","view","the","schema",")","."]
docstr: Create a LazyBlockList on the provided read tasks.
  
  Args:
      tasks: The read tasks that will produce the blocks of this lazy block list.
      read_stage_name: An optional name for the read stage, derived from the
          underlying Datasource
      block_partition_refs: An optional list of already submitted read task
          futures (i.e. block partition refs). This should be the same length as
          the tasks argument.
      block_partition_meta_refs: An optional list of block partition metadata
          refs. This should be the same length as the tasks argument.
      cached_metadata: An optional list of already computed AND fetched metadata.
          This serves as a cache of fetched block metadata. Note that each entry
          in cached_metadata represents the list of output blocks metadata per
          the read task. One task can produce multiple output blocks.
      ray_remote_args: Ray remote arguments for the read tasks.
      stats_uuid: UUID for the dataset stats, used to group and fetch read task
          stats. If not provided, a new UUID will be created.
code: def __init__(
      self,
      tasks: List[ReadTask],
      read_stage_name: Optional[str] = None,
      block_partition_refs: Optional[
          List[ObjectRef[MaybeBlockPartition]]
      ] = None,
      block_partition_meta_refs: Optional[
          List[ObjectRef[BlockMetadata]]
      ] = None,
      cached_metadata: Optional[List[BlockPartitionMetadata]] = None,
      ray_remote_args: Optional[Dict[str, Any]] = None,
      stats_uuid: str = None,
      *,
      owned_by_consumer: bool,
  ):
      """Create a LazyBlockList on the provided read tasks.
  
      Args:
          tasks: The read tasks that will produce the blocks of this lazy block list.
          read_stage_name: An optional name for the read stage, derived from the
              underlying Datasource
          block_partition_refs: An optional list of already submitted read task
              futures (i.e. block partition refs). This should be the same length as
              the tasks argument.
          block_partition_meta_refs: An optional list of block partition metadata
              refs. This should be the same length as the tasks argument.
          cached_metadata: An optional list of already computed AND fetched metadata.
              This serves as a cache of fetched block metadata. Note that each entry
              in cached_metadata represents the list of output blocks metadata per
              the read task. One task can produce multiple output blocks.
          ray_remote_args: Ray remote arguments for the read tasks.
          stats_uuid: UUID for the dataset stats, used to group and fetch read task
              stats. If not provided, a new UUID will be created.
      """
      self._tasks = tasks
      self._read_stage_name = read_stage_name
      self._num_blocks = len(self._tasks)
      if stats_uuid is None:
          stats_uuid = uuid.uuid4()
      self._stats_uuid = stats_uuid
      self._execution_started = False
      self._remote_args = ray_remote_args or {}
      # Block partition metadata that have already been computed and fetched.
      if cached_metadata is not None:
          self._cached_metadata = cached_metadata
      else:
          self._cached_metadata = [None] * len(tasks)
      # Block partition metadata that have already been computed.
      if block_partition_meta_refs is not None:
          self._block_partition_meta_refs = block_partition_meta_refs
      else:
          self._block_partition_meta_refs = [None] * len(tasks)
      # Block partitions that have already been computed.
      if block_partition_refs is not None:
          self._block_partition_refs = block_partition_refs
      else:
          self._block_partition_refs = [None] * len(tasks)
      assert len(tasks) == len(self._block_partition_refs), (
          tasks,
          self._block_partition_refs,
      )
      assert len(tasks) == len(self._block_partition_meta_refs), (
          tasks,
          self._block_partition_meta_refs,
      )
      assert len(tasks) == len(self._cached_metadata), (
          tasks,
          self._cached_metadata,
      )
      # Whether the block list is owned by consuming APIs, and if so it can be
      # eagerly deleted after read by the consumer.
      self._owned_by_consumer = owned_by_consumer
      self._stats_actor = _get_or_create_stats_actor()
      # This field can be set to indicate the number of estimated output blocks,
      # since each read task may produce multiple output blocks after splitting.
      self._estimated_num_blocks = None
  
imports: import math
  import uuid
  from typing import Any, Dict, Iterable, Iterator, List, Optional, Tuple, Union
  import ray
  from ray.data._internal.block_list import BlockList
  from ray.data._internal.memory_tracing import trace_allocation
  from ray.data._internal.progress_bar import ProgressBar
  from ray.data._internal.remote_fn import cached_remote_fn
  from ray.data._internal.stats import DatasetStats, _get_or_create_stats_actor
  from ray.data._internal.util import _split_list
  from ray.data.block import Block, BlockAccessor, BlockExecStats, BlockMetadata, BlockPartitionMetadata, MaybeBlockPartition
  from ray.data.context import DataContext
  from ray.data.datasource import ReadTask
  from ray.types import ObjectRef
label_desc: Use image node_id 1 to create a new LazyBlockList object from inherited base classes: BlockList with example: obj = LazyBlockList(tasks, read_stage_name, block_partition_refs, block_partition_meta_refs, cached_metadata, ray_remote_args, stats_uuid)