def gen_password_require(requirements, choices=ALPHANUMERIC, length=10):
    """
    Generate a password containing all the characters in requirements
    """
    if len(requirements) > length or not requirements_satisfied(requirements, choices):
        raise Exception(
            "That's impossible, you can't make a password containing %r with only %r!" % (
                requirements, choices))
    while True:
        pw = gen_password(choices, length)
        if requirements_satisfied(requirements, pw):
            return pw
dataset/ETHPy150Open gavinwahl/sdb/sdb/passwords.py/gen_password_require/original