<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(public_key, signature, hash, hash_algo):
 """Verify the given signature is correct for the given hash and public key. Args: public_key (str):
 PEM encoded public key signature (bytes):
 signature to verify hash (bytes):
 hash of data hash_algo (str):
 hash algorithm used Returns: True if the signature is valid, False otherwise """

    hash_algo = _hash_algorithms[hash_algo]
    try:
        return get_publickey(public_key).verify(
            signature,
            hash,
            padding.PKCS1v15(),
            utils.Prehashed(hash_algo),
        ) is None
    except InvalidSignature:
        return False