<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def on_enter(__msg: Optional[Union[Callable, str]] = None) -> Callable: """Decorator to display a message when entering a function. Args: __msg: Message to display Returns: Wrapped function """

    # pylint: disable=missing-docstring
    def decorator(__func):
        @wraps(__func)
        def wrapper(*args, **kwargs):
            if __msg:
                print(__msg)
            else:
                print('Entering {!r}({!r})'.format(__func.__name__, __func))
            return __func(*args, **kwargs)
        return wrapper
    if callable(__msg):
        return on_enter()(__msg)
    return decorator