parameters: (pattern_part, test_path_part)
return_statement: return re_pattern.match(test_path_part)
docstring: Checks whether a pattern (possibly with a *) matches the given string.
  
    Args:
      pattern_part: A string which may contain a wildcard (*).
      test_path_part: Another string.
  
    Returns:
      True if it matches, False otherwise.
docstring_summary: Checks whether a pattern (possibly with a *) matches the given string.
docstring_tokens: Checks whether a pattern ( possibly with a * ) matches the given string .
function: def _MatchesPatternPart(pattern_part, test_path_part):
    """Checks whether a pattern (possibly with a *) matches the given string.
  
    Args:
      pattern_part: A string which may contain a wildcard (*).
      test_path_part: Another string.
  
    Returns:
      True if it matches, False otherwise.
    """
    if pattern_part == '*' or pattern_part == test_path_part:
      return True
    if '*' not in pattern_part:
      return False
    # Escape any other special non-alphanumeric characters.
    pattern_part = re.escape(pattern_part)
    # There are not supposed to be any other asterisk characters, so all
    # occurrences of backslash-asterisk can now be replaced with dot-asterisk.
    re_pattern = re.compile('^' + pattern_part.replace('\\*', '.*') + '$')
    return re_pattern.match(test_path_part)
function_tokens: def _MatchesPatternPart ( pattern_part , test_path_part ) : if pattern_part == '*' or pattern_part == test_path_part : return True if '*' not in pattern_part : return False # Escape any other special non-alphanumeric characters. pattern_part = re . escape ( pattern_part ) # There are not supposed to be any other asterisk characters, so all # occurrences of backslash-asterisk can now be replaced with dot-asterisk. re_pattern = re . compile ( '^' + pattern_part . replace ( '\\*' , '.*' ) + '$' ) return re_pattern . match ( test_path_part )