def handle(self, *args, **options):
        try:
            username = args[0]
        except __HOLE__:
            raise CommandError(_("You must provide the username to publish the"
                                 " form to."))
            # make sure user exists
        try:
            User.objects.get(username=username)
        except User.DoesNotExist:
            raise CommandError(_("The user '%s' does not exist.") % username)

        try:
            input_file = args[1]
        except IndexError:
            raise CommandError(_("You must provide the path to restore from."))
        else:
            input_file = os.path.realpath(input_file)

        num_instances, num_restored = restore_backup_from_zip(
            input_file, username)
        sys.stdout.write("Restored %d of %d submissions\n" %
                         (num_restored, num_instances))
dataset/ETHPy150Open kobotoolbox/kobocat/onadata/apps/logger/management/commands/restore_backup.py/Command.handle