code: def fnmatch(filename: str, patterns: Sequence[str]) -> bool:
      """Wrap :func:`fnmatch.fnmatch` to add some functionality.
  
      :param filename:
          Name of the file we're trying to match.
      :param patterns:
          Patterns we're using to try to match the filename.
      :param default:
          The default value if patterns is empty
      :returns:
          True if a pattern matches the filename, False if it doesn't.
          ``True`` if patterns is empty.
      """
      if not patterns:
          return True
      return any(
          _fnmatch.fnmatch(filename, pattern) for pattern in patterns
      )
  
imports: from __future__ import annotations
  import fnmatch
  import functools
  import io
  import logging
  import os
  import platform
  import re
  import sys
  import textwrap
  import tokenize
  from typing import NamedTuple
  from typing import Pattern
  from typing import Sequence
  from flake8 import exceptions
label_desc: Use image node_id 9 for calling a global function with example usage: fnmatch(filename, patterns) and returns: any, True