

def register(server, account_path, email):
    if os.path.exists(account_path):
        if (not confirm('The account file {} already exists. Continuing will overwrite it with a new key. Continue?'.format(account_path), default=False)):
            raise ManualeError('Aborting.')
    if (not confirm("You're about to register a new account with the e-mail {}. Continue?".format(email))):
        raise ManualeError('Aborting.')
    logger.info('Generating a new account key. This might take a second.')
    account = Account(key=generate_rsa_key(4096))
    logger.info('Key generated.')
    acme = Acme(account_path, account)
    logger.info('Registering...')
    try:
        registration = acme.register(email)
        if registration.terms:
            logger.info('This server requires you to agree to these terms:')
            logger.info('  {}'.format(registration.terms))
            if (not confirm('Agreed?')):
                logger.error("Aborting. Your account was still created, but it won't be usable before agreeing to terms.")
                raise ManualeError()
            acme.update_registration({
                'agreement': registration.terms,
            })
            logger.info('Updated account with agreement.')
        logger.info('Account {} created.'.format(account.uri))
    except IOError as e:
        logger.error('Registration failed due to a connection or request error.')
        raise ManualeError(e)
    directory = os.path.dirname(os.path.abspath(account_path))
    os.makedirs(directory, exist_ok=True)
    with open(account_path, 'wb') as f:
        os.chmod(account_path, 384)
        f.write(account.serialize())
    logger.info('Wrote account to {}.'.format(account_path))
    logger.info('')
    logger.info("What next? Verify your domains with 'authorize' and use 'issue' to get new certificates.")

dataset/ETHPy150Open veeti/manuale/manuale/register.py register/VarMisuse@107/220 `server`->`account_path`