docs: def remove_padding(sequence):
    """Selects the used frames of a sequence, up to its length.
  
    This function does not expect a batch of sequences, but a single sequence.
    The sequence must be a dict with `length` key, which will removed from the
    result.
  
    Args:
      sequence: Nested dict of tensors with time dimension.
  
    Returns:
      Nested dict of tensors with padding elements and `length` key removed.
    """
    length = sequence.pop('length')
    sequence = tools.nested.map(lambda tensor: tensor[:length], sequence)
    return sequence