parameters: (self, path_pattern)
return_statement: return True
docstring: Return True if this path matches the given pattern.
docstring_summary: Return True if this path matches the given pattern.
docstring_tokens: Return True if this path matches the given pattern .
function: def match(self, path_pattern):
          """
          Return True if this path matches the given pattern.
          """
          cf = self._flavour.casefold
          path_pattern = cf(path_pattern)
          drv, root, pat_parts = self._flavour.parse_parts((path_pattern,))
          if not pat_parts:
              raise ValueError("empty pattern")
          if drv and drv != cf(self._drv):
              return False
          if root and root != cf(self._root):
              return False
          parts = self._cparts
          if drv or root:
              if len(pat_parts) != len(parts):
                  return False
              pat_parts = pat_parts[1:]
          elif len(pat_parts) > len(parts):
              return False
          for part, pat in zip(reversed(parts), reversed(pat_parts)):
              if not fnmatch.fnmatchcase(part, pat):
                  return False
          return True
function_tokens: def match ( self , path_pattern ) : cf = self . _flavour . casefold path_pattern = cf ( path_pattern ) drv , root , pat_parts = self . _flavour . parse_parts ( ( path_pattern , ) ) if not pat_parts : raise ValueError ( "empty pattern" ) if drv and drv != cf ( self . _drv ) : return False if root and root != cf ( self . _root ) : return False parts = self . _cparts if drv or root : if len ( pat_parts ) != len ( parts ) : return False pat_parts = pat_parts [ 1 : ] elif len ( pat_parts ) > len ( parts ) : return False for part , pat in zip ( reversed ( parts ) , reversed ( pat_parts ) ) : if not fnmatch . fnmatchcase ( part , pat ) : return False return True