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