<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def crack_secret_exponent_from_k(generator, signed_value, sig, k):
 """ Given a signature of a signed_value and a known k, return the secret exponent. """

    r, s = sig
    return ((s * k - signed_value) * generator.inverse(r)) % generator.order()