def fnmatch( name, pat ):
    """Test whether FILENAME matches PATTERN.

    Patterns are Unix shell style:

    *       matches everything
    ?       matches any single character
    [seq]   matches any character in seq
    [!seq]  matches any char not in seq

    An initial period in FILENAME is not special.
    Both FILENAME and PATTERN are first case-normalized
    if the operating system requires it.
    If you don't want this, use fnmatchcase(FILENAME, PATTERN).

    >>> fnmatch('bar', '*' )
    True
    >>> fnmatch('foo/bar', '*' )
    False
    >>> fnmatch('foo/bar', '**' )
    True
    >>> fnmatch('foo/bar', '*/*' )
    True
    >>> fnmatch('foo/bar', '**/*' )
    True
    >>> fnmatch('/bar', '**/*' )
    True
    >>> fnmatch('/', '**' )
    True
    >>> fnmatch('/', '*' )
    False
    """

    import os

    name = os.path.normcase( name )
    pat = os.path.normcase( pat )
    return fnmatchcase( name, pat )
Test whether FILENAME matches PATTERN.

    Patterns are Unix shell style:

    *       matches everything
    ?       matches any single character
    [seq]   matches any character in seq
    [!seq]  matches any char not in seq

    An initial period in FILENAME is not special.
    Both FILENAME and PATTERN are first case-normalized
    if the operating system requires it.
    If you don't want this, use fnmatchcase(FILENAME, PATTERN).

    >>> fnmatch('bar', '*' )
    True
    >>> fnmatch('foo/bar', '*' )
    False
    >>> fnmatch('foo/bar', '**' )
    True
    >>> fnmatch('foo/bar', '*/*' )
    True
    >>> fnmatch('foo/bar', '**/*' )
    True
    >>> fnmatch('/bar', '**/*' )
    True
    >>> fnmatch('/', '**' )
    True
    >>> fnmatch('/', '*' )
    False