class_docstr: Writes given dataset into FFCV format (.beton).
  Supports indexable objects (e.g., PyTorch Datasets) and webdataset.
  
  Parameters
  ----------
  fname: str
      File name to store dataset in FFCV format (.beton)
  fields : Mapping[str, Field]
      Map from keys to Field's (order matters!)
  page_size : int
      Page size used internally
  num_workers : int
      Number of processes to use
docstr: Read dataset from an indexable dataset.
  See https://docs.ffcv.io/writing_datasets.html#indexable-dataset for sample usage.
  
  Parameters
  ----------
  dataset: Indexable
      An indexable object that implements `__getitem__` and `__len__`.
  indices : List[int]
      Use a subset of the dataset specified by indices.
  chunksize : int
      Size of chunks processed by each worker during conversion.
  shuffle_indices : bool
      Shuffle order of the dataset.
docstr_tok: ["Read","dataset","from","an","indexable","dataset",".","See","https",":","\/\/docs.ffcv.io\/writing_datasets.html","#","indexable-dataset","for","sample","usage",".","Parameters","--","--","--","--","--","dataset",":","Indexable","An","indexable","object","that","implements","`","__getitem__","`","and","`","__len__","`",".","indices",":","List","[","int","]","Use","a","subset","of","the","dataset","specified","by","indices",".","chunksize",":","int","Size","of","chunks","processed","by","each","worker","during","conversion",".","shuffle_indices",":","bool","Shuffle","order","of","the","dataset","."]
code: def from_indexed_dataset(
      self,
      dataset,
      indices: List[int] = None,
      chunksize=100,
      shuffle_indices: bool = False,
  ):
      """Read dataset from an indexable dataset.
      See https://docs.ffcv.io/writing_datasets.html#indexable-dataset for sample usage.
  
      Parameters
      ----------
      dataset: Indexable
          An indexable object that implements `__getitem__` and `__len__`.
      indices : List[int]
          Use a subset of the dataset specified by indices.
      chunksize : int
          Size of chunks processed by each worker during conversion.
      shuffle_indices : bool
          Shuffle order of the dataset.
      """
      # If the user didn't specify an order we just add samples
      # sequentially
      if indices is None:
          indices = np.arange(len(dataset))
  
      if shuffle_indices:
          np.random.shuffle(indices)
  
      # We add indices to the indices so that workers know where
      # to write in the metadata array
      indices: List[int] = list(enumerate(indices))
  
      self._write_common(
          len(indices),
          chunks(indices, chunksize),
          worker_job_indexed_dataset,
          (dataset,),
      )
  
imports: from functools import partial
  from typing import Callable, List, Mapping
  from os import SEEK_END, path
  import numpy
  from time import sleep
  import ctypes
  from multiprocessing import shared_memory, cpu_count, Queue, Process, Value
  from tqdm import tqdm
  from tqdm.contrib.concurrent import thread_map
  from .utils import chunks, is_power_of_2
  from .fields.base import Field
  from .memory_allocator import MemoryAllocator
  from .types import TYPE_ID_HANDLER, get_metadata_type, HeaderType, FieldDescType, CURRENT_VERSION, ALLOC_TABLE_TYPE
label_desc: Use image node_id 4 for calling the DatasetWriter obj's underlying member method code with example usage: obj.from_indexed_dataset(dataset, indices, chunksize, shuffle_indices) without return types