def METHOD_NAME(path, pattern):
    """Return True if path matches pattern.
    This uses fnmatch to perform unix-style filename pattern matching.
    """
    if api.settings.search.ignore_case.value:
        return fnmatch.fnmatchcase(path.lower(), f"*{pattern.lower()}*")
    return fnmatch.fnmatchcase(path, f"*{pattern}*")