human
I wrote the below code

    def verify_otp(otp, pin, secret, offset=60):
        epoch_time = int(time.time())
        time_start = int(str((epoch_time - offset))[:(-1)])
        time_end = int(str((epoch_time + offset))[:(-1)])
        for t in range((time_start - 1), (time_end + 1)):
            to_hash = ((str(t) + secret) + pin)
            hash = md5(to_hash).hexdigest()[:6]
            if (otp == hash):
                return True
        return False
    def motp_auth_aux(email, password, db=db, offset=time_offset):
        if db:
            user_data = db((db.auth_user.email == email)).select().first()
            if user_data:
                if (user_data['motp_secret'] and user_data['motp_pin']):
                    motp_secret = user_data['motp_secret']
                    motp_pin = user_data['motp_pin']
                    otp_check = verify_otp(password, motp_pin, motp_secret, offset=offset)
                    if otp_check:
                        return True
                    else:
                        return False
                else:
                    return False
        return False
    return motp_auth_aux

What's a good function header?

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

def motp_auth(db=DAL('sqlite://storage.sqlite'), time_offset=60):