<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def int_or_str(v: Optional[str]) -> Union[None, int, str]: """Safe converts an string represent an integer to an integer or passes through ``None``."""

    if v is None:
        return
    try:
        return int(v)
    except ValueError:
        return v