<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def peek(rlp, index, sedes=None):
 """Get a specific element from an rlp encoded nested list. This function uses :func:`rlp.decode_lazy` and, thus, decodes only the necessary parts of the string. Usage example:: 1 3 :param rlp: the rlp string :param index: the index of the element to peek at (can be a list for nested data) :param sedes: a sedes used to deserialize the peeked at object, or `None` if no deserialization should be performed :raises: :exc:`IndexError` if `index` is invalid (out of range or too many levels) """

    ll = decode_lazy(rlp)
    if not isinstance(index, Iterable):
        index = [index]
    for i in index:
        if isinstance(ll, Atomic):
            raise IndexError('Too many indices given')
        ll = ll[i]
    if sedes:
        return sedes.deserialize(ll)
    else:
        return ll