<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def valid_url(x: str) -> bool: """ Return ``True`` if ``x`` is a valid URL; otherwise return ``False``. """

    if isinstance(x, str) and re.match(URL_PATTERN, x):
        return True
    else:
        return False