from typing import Optional


def try_get_only_key_from_collection(collection: Optional[dict]) -> Optional[str]:
    """
    3 scenarios:
    1 - dict is None or empty -> return None
    2 - dict has exactly one item, return its key
    3 - dict has more than one item, raise exception
    """
    if collection is None or len(collection) == 0:
        return None
    if len(collection) == 1:
        return next(iter(collection.keys()))
    raise ValueError(f'{collection.keys()} has more than 1 key, cannot decide which to pick')