from typing import Union
from typing import List


def get_attribute(object, name: Union[List[str], str]):
    """Return an attribute of an object."""
    components = name.split(".") if isinstance(name, str) else name

    for component in components:
        object = getattr(object, component)

    return object