class_docstr: - **homepage**: https://cs.stanford.edu/people/jcjohns/clevr/
class_docstr_tok: ["-","*","*","homepage","*","*",":","https",":","\/\/cs.stanford.edu\/people\/jcjohns\/clevr\/"]
code: def _prepare_sample(
      self, data: Tuple[Tuple[str, BinaryIO], Optional[Dict[str, Any]]]
  ) -> Dict[str, Any]:
      image_data, scenes_data = data
      path, buffer = image_data
  
      return dict(
          path=path,
          image=EncodedImage.from_file(buffer),
          label=Label(len(scenes_data["objects"]))
          if scenes_data
          else None,
      )
  
file_path: vision/torchvision/prototype/datasets/_builtin/clevr.py
imports: import pathlib
  from typing import Any, BinaryIO, Dict, List, Optional, Tuple, Union
  from torchdata.datapipes.iter import Demultiplexer, Filter, IterDataPipe, IterKeyZipper, JsonParser, Mapper, UnBatcher
  from torchvision.prototype.datasets.utils import Dataset, EncodedImage, HttpResource, OnlineResource
  from torchvision.prototype.datasets.utils._internal import getitem, hint_sharding, hint_shuffling, INFINITE_BUFFER_SIZE, path_accessor, path_comparator
  from torchvision.prototype.tv_tensors import Label
  from .._api import register_dataset, register_info
label_desc: Use image node_id 6 for calling the CLEVR obj's underlying member method code with example usage: obj._prepare_sample(data) and returns: dict