code: def _build_ds_from_instruction(instruction, ds_from_file_fn):
    
    # Create the example and mask ds for this particular shard
    examples_ds = ds_from_file_fn(instruction["filepath"])
    mask_ds = _build_mask_ds(
        mask_offset=instruction["mask_offset"],
        mask=instruction["mask"],
    )
  
    # Zip the mask and real examples
    ds = tf.data.Dataset.zip((examples_ds, mask_ds))
    # Filter according to the mask (only keep True)
    ds = ds.filter(lambda example, mask: mask)
    # Only keep the examples
    ds = ds.map(lambda example, mask: example)
    return ds
docs: Map an instruction to a real datasets for one particular shard.
  
    Args:
      instruction: A `dict` of `tf.Tensor` containing the instruction to load
        the particular shard (filename, mask,...)
      ds_from_file_fn: `fct`, function which returns the dataset associated to
        the filename
  
    Returns:
      dataset: `tf.data.Dataset`, The shard loaded from the instruction