from typing import Optional
from typing import Union
from datetime import datetime


def fix_time_retrieved(s: str) -> Optional[Union[str, datetime]]:
    """
    Fixes timestamps of the format: 15-Jul-2021 (22:29:25.643316)
    """
    if not s or s == "None":
        return s
    return datetime.strptime(s, "%d-%b-%Y (%H:%M:%S.%f)")