<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def lock(key, text):
 """Locks the given text using the given key and returns the result"""

    return hmac.new(key.encode('utf-8'), text.encode('utf-8')).hexdigest()