<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def match_patterns(pathname, patterns):
 """Returns ``True`` if the pathname matches any of the given patterns."""

    for pattern in patterns:
        if fnmatch(pathname, pattern):
            return True
    return False