human
I wrote the below code

    h = hmac.new(s, digestmod=getattr(hashlib, f))
    def prf(h, s):
        h = h.copy()
        h.update(s)
        return bytearray(h.digest())
    k = bytearray()
    i = 1
    while (len(k) < n):
        a = b = prf(h, (salt + struct.pack('>i', i)))
        for _ in range((iterations - 1)):
            a = prf(h, a)
            b = bytearray(((x ^ y) for (x, y) in zip(b, a)))
        k += b
        i += 1
    return str(k)[:n].encode('hex')

What's a good function header?
assistant
#Here's a good function header.

def pbkdf2(s, salt, iterations=10000, n=32, f='sha256'):