code: def match_etag(etag, header, weak=False):
      
      if etag is None:
          return False
      m = etag_re.match(etag)
      if not m:
          raise ValueError("Not a well-formed ETag: '%s'" % etag)
      (is_weak, etag) = m.groups()
      parsed_header = parse_etag_header(header)
      if parsed_header == '*':
          return True
      if is_weak and not weak:
          return False
      if weak:
          return etag in [t[1] for t in parsed_header]
      else:
          return etag in [t[1] for t in parsed_header if not t[0]]
docs: Try to match an ETag against a header value.
  
      If `weak` is True, uses the weak comparison function.