from typing import Union
from typing import List
from typing import Tuple


def get_match_patterns(filters: Union[str, List[str]]) -> Tuple[List[str], List[str]]:
    """The function to parse 'filters' defined as a single string into the lists
    of 'include' and 'exclude' patterns.

    >>> get_match_patterns("")
    ([], [])

    >>> get_match_patterns(":")
    ([], [])

    >>> get_match_patterns(":!")
    ([], [])

    >>> get_match_patterns("f:")
    (['f'], [])

    >>> get_match_patterns("f:!f 1")
    (['f'], ['f 1'])

    >>> get_match_patterns("f:!f 1:f 2:!f 3")
    (['f', 'f 2'], ['f 1', 'f 3'])

    >>> get_match_patterns(["f", "!f 1"])
    (['f'], ['f 1'])
    """
    if not isinstance(filters, str):
        filters = ":".join(filters) if filters else ""

    include: List[str] = []
    exclude: List[str] = []

    filters = filters.split(':')
    for f in filters:
        if f.startswith('!'):
            if len(f) > 1:
                exclude.append(f[1:])
        elif f:
            include.append(f)
    return include, exclude