def _match(self, **kwargs):
for k in kwargs.keys():<EOL><INDENT>try:<EOL><INDENT>val = getattr(self, k)<EOL><DEDENT>except _a11y.Error:<EOL><INDENT>return False<EOL><DEDENT>if sys.version_info[:<NUM_LIT:2>] <= (<NUM_LIT:2>, <NUM_LIT:6>):<EOL><INDENT>if isinstance(val, basestring):<EOL><INDENT>if not fnmatch.fnmatch(unicode(val), kwargs[k]):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if val != kwargs[k]:<EOL><INDENT>return False<EOL><DEDENT><DEDENT><DEDENT>elif sys.version_info[<NUM_LIT:0>] == <NUM_LIT:3>:<EOL><INDENT>if isinstance(val, str):<EOL><INDENT>if not fnmatch.fnmatch(val, str(kwargs[k])):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if val != kwargs[k]:<EOL><INDENT>return False<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>if isinstance(val, str) or isinstance(val, unicode):<EOL><INDENT>if not fnmatch.fnmatch(val, kwargs[k]):<EOL><INDENT>return False<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if val != kwargs[k]:<EOL><INDENT>return False<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return True<EOL>
Method which indicates if the object matches specified criteria.

        Match accepts criteria as kwargs and looks them up on attributes.
        Actual matching is performed with fnmatch, so shell-like wildcards
        work within match strings. Examples:

        obj._match(AXTitle='Terminal*')
        obj._match(AXRole='TextField', AXRoleDescription='search text field')