def _thread_worker_fn(samples, batchify_fn, dataset):
if isinstance(samples[<NUM_LIT:0>], (list, tuple)):<EOL><INDENT>batch = [batchify_fn([dataset[i] for i in shard]) for shard in samples]<EOL><DEDENT>else:<EOL><INDENT>batch = batchify_fn([dataset[i] for i in samples])<EOL><DEDENT>return batch<EOL>
Threadpool worker function for processing data.