from typing import List
from typing import Any
import random


def pop_random_element(somelist: List[Any]) -> Any:
    """Pop off a random element from the list."""
    if not somelist:
        raise IndexError('pop_random_element: list is empty')
    idx = random.randrange(0, len(somelist))
    return somelist.pop(idx)