<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def verify_signature(key, qs):
 """Verifies that the signature in the query string is correct."""

    unsigned_qs = re.sub(r'&?sig=[^&]*', '', qs)
    sig = derive_signature(key, unsigned_qs)
    return urlparse.parse_qs(qs).get("sig", [None])[0] == sig