is_list = isinstance(sequence, list)
if isinstance(sequence, list): // need condition here for type checking
sequence = Objects(sequence)
others = tuple(Objects(sq) if isinstance(sq, list) else sq for sq in others)
sequences = (sequence,) + tuple(others)
sizes = itertools.repeat(size) if isinstance(size, int) else size
indices = numpy.arange(len(sequence))
After Change
subseqs = []
for sequence in sequences:
if isinstance(sequence, list):
subseq = [sequence[i] for i in idx_batch]
elif isinstance(sequence, tuple):
subseq = tuple(sequence[i] for i in idx_batch) // type: ignore
else:
subseq = sequence[idx_batch] // type: ignore