<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sign(self, msg, key):
 """ Create a signature over a message as defined in RFC7515 using a symmetric key :param msg: The message :param key: The key :return: A signature """

        h = hmac.HMAC(key, self.algorithm(), default_backend())
        h.update(msg)
        return h.finalize()