in basic_pitch/data/tf_example_deserialization.py [0:0]
def _validation_file_generator(x: Dict[str, tf.data.Dataset]) -> Iterator[tf.Tensor]:
"""file generator for validation sets"""
x = {k: list(v) for (k, v) in x.items()}
# loop until there are no more test files
while any(x.values()):
# alternate between datasets (dataset 1 elt 1, dataset 2, elt 1, ...)
# this is so test files in the tensorboard have 4 different datasets
# instead of 4 elements from 1
for k in x:
# if the list of files for this dataset is empty skip it
if x[k]:
yield x[k].pop()