Implement a data-loading routine optimized for high-throughput batching and minimal I/O overhead in ML pipelines.
Implement load_batches(shards, requests, batch_size). shards maps each shard ID to an array of sample values, and requests contains (shard_id, sample_index) pairs. Read each referenced shard at most once, process shards in their first-request order, preserve request order within each shard, and return consecutive batches of at most batch_size values.
Return a list of lists containing the loaded values.
def load_batches(shards, requests, batch_size):