code: def _pattern_match(self, item, pattern):
          
          if pattern.endswith('*'):
              return item.startswith(pattern[:-1])
          else:
              return item == pattern
docs: Determine whether the item supplied is matched by the pattern.