MCPcopy Create free account
hub / github.com/PrathamLearnsToCode/paper2code / __getitem__

Function __getitem__

skills/paper2code/scaffolds/data_template.py:76–88  ·  view source on GitHub ↗

Load and preprocess a single sample. Returns: dict with keys: {{key_1}}: {{description}} — shape: {{shape}} {{key_2}}: {{description}} — shape: {{shape}}

(self, idx: int)

Source from the content-addressed store, hash-verified

74 return len(self.samples)
75
76 def __getitem__(self, idx: int) -> Dict[str, torch.Tensor]:
77 """Load and preprocess a single sample.
78
79 Returns:
80 dict with keys:
81 {{key_1}}: {{description}} — shape: {{shape}}
82 {{key_2}}: {{description}} — shape: {{shape}}
83 """
84 # TODO: Implement sample loading
85 # sample = self.samples[idx]
86 # processed = self._preprocess(sample)
87 # return processed
88 raise NotImplementedError("Implement __getitem__ for your data format")
89
90
91def build_dataloader(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected