<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def reset(ctx):
 """ Reset all OATH data. This action will wipe all credentials and reset factory settings for the OATH application on the YubiKey. """


    controller = ctx.obj['controller']
    click.echo('Resetting OATH data...')
    old_id = controller.id
    controller.reset()

    settings = ctx.obj['settings']
    keys = settings.setdefault('keys', {})
    if old_id in keys:
        del keys[old_id]
        settings.write()

    click.echo(
        'Success! All OATH credentials have been cleared from your YubiKey.')