human
I wrote the below code

    if isinstance(hashfunc, string_types):
        hashfunc = _hash_funcs[hashfunc]
    elif (not hashfunc):
        hashfunc = hashlib.sha256
    data = to_bytes(data)
    salt = to_bytes(salt)
    if _has_native_pbkdf2:
        _test_hash = hashfunc()
        if (hasattr(_test_hash, 'name') and (_test_hash.name in _hash_funcs)):
            return hashlib.pbkdf2_hmac(_test_hash.name, data, salt, iterations, keylen)
    mac = hmac.HMAC(data, None, hashfunc)
    if (not keylen):
        keylen = mac.digest_size
    def _pseudorandom(x, mac=mac):
        h = mac.copy()
        h.update(x)
        return bytearray(h.digest())
    buf = bytearray()
    for block in range_type(1, ((- ((- keylen) // mac.digest_size)) + 1)):
        rv = u = _pseudorandom((salt + _pack_int(block)))
        for i in range_type((iterations - 1)):
            u = _pseudorandom(bytes(u))
            rv = bytearray(starmap(xor, izip(rv, u)))
        buf.extend(rv)
    return bytes(buf[:keylen])

What's a good function header?

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

def pbkdf2_bin(data, salt, iterations=DEFAULT_PBKDF2_ITERATIONS, keylen=None, hashfunc=None):