docstr: Retrieves the associated chunk_index for a given chunk filename.
docstr_tok: ["Retrieves","the","associated","chunk_index","for","a","given","chunk","filename","."]
code: def _get_chunk_index_from_filename(self, chunk_filename: str) -> int:
      """Retrieves the associated chunk_index for a given chunk filename."""
      for chunk_index, chunk in enumerate(self._chunks):
          if chunk["filename"] == chunk_filename:
              return chunk_index
      raise ValueError(
          f"The provided filename doesn't exist {chunk_filename}."
      )
  
imports: import json
  import os
  from typing import Any, Dict, List, Optional, Tuple
  from lightning.data.streaming.constants import _INDEX_FILENAME, _TORCH_GREATER_EQUAL_2_1_0
  from lightning.data.streaming.downloader import get_downloader_cls
  from lightning.data.streaming.item_loader import BaseItemLoader, PyTreeLoader, TokensLoader
  from lightning.data.streaming.sampler import ChunkedIndex
  from lightning.data.streaming.serializers import Serializer
label_desc: Use image node_id 12 for calling the ChunksConfig obj's underlying member method code with example usage: obj._get_chunk_index_from_filename(chunk_filename) and returns: chunk_index