from typing import Sequence
import fnmatch


def _should_ignore(fd_name: str, patterns: Sequence[str]) -> bool:
    """Return whether `fd_name` should be ignored according to `patterns`.

    Examples
    --------
    >>> fd_name = "google/protobuf/empty.proto"
    >>> pattern = "google/protobuf/*"
    >>> _should_ignore(fd_name, [pattern])
    True
    >>> fd_name = "foo/bar"
    >>> _should_ignore(fd_name, [pattern])
    False
    """
    return any(fnmatch.fnmatchcase(fd_name, pattern) for pattern in patterns)