import random


def sample(items, n=None, seed=None):
    """Get a sample of `n` items without replacement.

    If n is None, return the input after shuffling it.
    """
    if seed:
        random.seed(seed)
    if n is None:
        n = len(items)
    return random.sample(items, k=n)