from typing import List
from typing import Any
from typing import Optional


def get_entity(entities: List[Any]) -> Optional[Any]:
    """ Silently return first element of a list, or unchanged value otherwise
    """
    return next(iter(entities), None) if isinstance(entities, (list, tuple)) else entities