original_docstring: FNMatcher port from py.path.common which works with PurePath() instances.
  
      The difference between this algorithm and PurePath.match() is that the latter matches "**" glob expressions
      for each part of the path, while this algorithm uses the whole path instead.
  
      For example:
          "tests/foo/bar/doc/test_foo.py" matches pattern "tests/**/doc/test*.py" with this algorithm, but not with
          PurePath.match().
  
      This algorithm was ported to keep backward-compatibility with existing settings which assume paths match according
      this logic.
  
      References:
      * https://bugs.python.org/issue29249
      * https://bugs.python.org/issue34731
      
docstring: FNMatcher port from py.path.common which works with PurePath() instances.
  The difference between this algorithm and PurePath.match() is that the latter matches "**" glob expressions
  for each part of the path, while this algorithm uses the whole path instead.
  
  
  
  This algorithm was ported to keep backward-compatibility with existing settings which assume paths match according
  this logic.
  
  
docstring_tokens: FNMatcher port from py . path . common which works with PurePath () instances . The difference between this algorithm and PurePath . match () is that the latter matches " ** " glob expressions for each part of the path while this algorithm uses the whole path instead . This algorithm was ported to keep backward - compatibility with existing settings which assume paths match according this logic .
code: def fnmatch_ex(pattern, path):
      """FNMatcher port from py.path.common which works with PurePath() instances.
  
      The difference between this algorithm and PurePath.match() is that the latter matches "**" glob expressions
      for each part of the path, while this algorithm uses the whole path instead.
  
      For example:
          "tests/foo/bar/doc/test_foo.py" matches pattern "tests/**/doc/test*.py" with this algorithm, but not with
          PurePath.match().
  
      This algorithm was ported to keep backward-compatibility with existing settings which assume paths match according
      this logic.
  
      References:
      * https://bugs.python.org/issue29249
      * https://bugs.python.org/issue34731
      """
      path = PurePath(path)
      iswin32 = sys.platform.startswith("win")
  
      if iswin32 and sep not in pattern and posix_sep in pattern:
          # Running on Windows, the pattern has no Windows path separators,
          # and the pattern has one or more Posix path separators. Replace
          # the Posix path separators with the Windows path separator.
          pattern = pattern.replace(posix_sep, sep)
  
      if sep not in pattern:
          name = path.name
      else:
          name = six.text_type(path)
      return fnmatch.fnmatch(name, pattern)
code_tokens: def fnmatch_ex ( pattern , path ) : path = PurePath ( path ) iswin32 = sys . platform . startswith ( "win" ) if iswin32 and sep not in pattern and posix_sep in pattern : pattern = pattern . replace ( posix_sep , sep ) if sep not in pattern : name = path . name else : name = six . text_type ( path ) return fnmatch . fnmatch ( name , pattern )
short_docstring: FNMatcher port from py.path.common which works with PurePath() instances.
short_docstring_tokens: FNMatcher port from py . path . common which works with PurePath () instances .
comment: """FNMatcher port from py.path.common which works with PurePath() instances.
  
      The difference between this algorithm and PurePath.match() is that the latter matches "**" glob expressions
      for each part of the path, while this algorithm uses the whole path instead.
  
      For example:
          "tests/foo/bar/doc/test_foo.py" matches pattern "tests/**/doc/test*.py" with this algorithm, but not with
          PurePath.match().
  
      This algorithm was ported to keep backward-compatibility with existing settings which assume paths match according
      this logic.
  
      References:
      * https://bugs.python.org/issue29249
      * https://bugs.python.org/issue34731
      """$SEP$# Running on Windows, the pattern has no Windows path separators,$SEP$# and the pattern has one or more Posix path separators. Replace$SEP$# the Posix path separators with the Windows path separator.