def gather(x, indices):
    """
    Return the sequence [x[i] for i in indices].

    >>> gather([8, 16, 32, 64, 128], [3, 0, 2])
    [64, 8, 32]

    >>> gather([8, 16, 32, 64, 128], [])
    []
    """
    return [x[i] for i in indices]