def _is_owner_ignored(owner, name, ignored_classes, ignored_modules):
ignored_modules = set(ignored_modules)<EOL>module_name = owner.root().name<EOL>module_qname = owner.root().qname()<EOL>if any(<EOL>module_name in ignored_modules<EOL>or module_qname in ignored_modules<EOL>or fnmatch.fnmatch(module_qname, ignore)<EOL>for ignore in ignored_modules<EOL>):<EOL><INDENT>return True<EOL><DEDENT>ignored_classes = set(ignored_classes)<EOL>if hasattr(owner, "<STR_LIT>"):<EOL><INDENT>qname = owner.qname()<EOL><DEDENT>else:<EOL><INDENT>qname = "<STR_LIT>"<EOL><DEDENT>return any(ignore in (name, qname) for ignore in ignored_classes)<EOL>
Check if the given owner should be ignored

    This will verify if the owner's module is in *ignored_modules*
    or the owner's module fully qualified name is in *ignored_modules*
    or if the *ignored_modules* contains a pattern which catches
    the fully qualified name of the module.

    Also, similar checks are done for the owner itself, if its name
    matches any name from the *ignored_classes* or if its qualified
    name can be found in *ignored_classes*.