def run(self, messages):
        """If the --export parameter was used, downloads all submissions
        for the current assignment from the server and then exits
        """
        if not self.args.export:
            return

        self.access_token = auth.authenticate(self.args.authenticate)
        log.info('Authenticated with access token %s', self.access_token)

        data = None
        try:
            data = pickle.load(open(EXPORT_CACHE, "rb"))
        except IOError:
            data = {
                'endpoint': self.assignment.endpoint
            }
            data['assign'], data['course'] = self.get_ids(data['endpoint'])
            data['students'] = self.get_students(data['course'])
            if not data['students']:
                return
            data['current'] = 0

        current_student = 0
        try:
            if not os.path.exists(SUBMISSION_DIR):
                os.makedirs(SUBMISSION_DIR)

            downloads_left = data['current'] - len(data['students'])

            print("{0} submissions left to download.".format(downloads_left))

            for current_student in range(data['current'], len(data['students'])):
                student = data['students'][current_student]
                try:
                    self.download_submission(student, data['assign'])
                except (IOError, error.HTTPError):
                    data['current'] = current_student
                    abort(data, len(data['students']), current_student)
                    return
                data['current'] = current_student + 1

        except KeyboardInterrupt:
            pickle.dump(data, open("export_cache.pkl", "wb"))
            abort(data, len(data['students']), current_student)
            return

        print("Submissions downloaded.")
        if os.path.exists(EXPORT_CACHE):
            os.remove(EXPORT_CACHE)
dataset/ETHPy150Open Cal-CS-61A-Staff/ok-client/client/protocols/export.py/ExportProtocol.run/swapped operands of `-`