<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_cluster(pg_cluster='main', pg_version=None, encoding=u'UTF-8', locale=u'en_US.UTF-8'):
 """Drop and restore a given cluster."""

    warning = u'You are about to drop the %s cluster. This cannot be undone.' \
              u' Are you sure you want to continue?' % pg_cluster
    if confirm(warning, default=False):
        version = pg_version or detect_version()
        config = {'version': version, 'cluster': pg_cluster,
                  'encoding': encoding, 'locale': locale}
        sudo(u'pg_dropcluster --stop %(version)s %(cluster)s' % config,
             user='postgres', warn_only=True)
        sudo(u'pg_createcluster --start -e %(encoding)s --locale %(locale)s'
             u' %(version)s %(cluster)s' % config, user='postgres')
    else:
        abort(u"Dropping %s cluster aborted by user input." % pg_cluster)