Attempt to kill the remote job associated with this submission id.
        :param submissionid:
        :param user_check: Check if the current user owns this submission
        :return: True if the job was killed, False if an error occurred
355303
def kill_running_submission(self, submissionid, user_check=True):
        
        submission = self.get_submission(submissionid, user_check)
        if not submission:
            return False
        if "jobid" not in submission:
            return False

        return self._client.kill_job(submission["jobid"])
483865
def del_calculation(job_id, confirmed=False):
    
    if logs.dbcmd('get_job', job_id) is None:
        print('There is no job %d' % job_id)
        return

    if confirmed or confirm(
            'Are you sure you want to (abort and) delete this calculation and '
            'all associated outputs?\nThis action cannot be undone. (y/n): '):
        try:
            abort(job_id)
            resp = logs.dbcmd('del_calc', job_id, getpass.getuser())
        except RuntimeError as err:
            safeprint(err)
        else:
            if 'success' in resp:
                print('Removed %d' % job_id)
            else:
                print(resp['error'])
1047063
def expire_submission(submission_id, opts = {})
      data, _status_code, _headers = expire_submission_with_http_info(submission_id, opts)
      data
    end
778434
def execute
      return :locked if @resource.locked_to_user? @headers

      if @resource.true? options[:overwrite]
        previous_resource_existed = overwrite_destination
      end

      status = super
      return status if %i[precondition_failed conflict].include? status

      @resource.delete_collection

      response_status status, previous_resource_existed
    end
1203165
def remove_tweet(self, id):
        
        try:
            self._client.destroy_status(id=id)
            return True
        except TweepError as e:
            if e.api_code in [TWITTER_PAGE_DOES_NOT_EXISTS_ERROR, TWITTER_DELETE_OTHER_USER_TWEET]:
                return False
            raise
244465
def delete_user(self, id):
        
        self.assert_has_permission('scim.write')

        uri = self.uri + '/Users/%s' % id
        headers = self._get_headers()

        logging.debug("URI=" + str(uri))
        logging.debug("HEADERS=" + str(headers))

        response = self.session.delete(uri, headers=headers)
        logging.debug("STATUS=" + str(response.status_code))
        if response.status_code == 200:
            return response
        else:
            logging.error(response.content)
            response.raise_for_status()
251121
def submission_post_save(sender, instance, **kwargs):
    ''' '''
    logger.debug("Running post-processing for submission")
    # Make the submitter an author
    if instance.submitter not in instance.authors.all():
        instance.authors.add(instance.submitter)
        instance.save()
    # Mark all existing submissions for this assignment by these authors as invalid.
    # This fixes a race condition with parallel new submissions in multiple browser windows by the same user.
    # Solving this as pre_save security exception does not work, since we have no instance with valid foreign keys to check there.
    # Considering that this runs also on tutor correction backend activities, it also serves as kind-of cleanup functionality
    # for multiplse submissions by the same students for the same assignment - however they got in here.
    if instance.state == instance.get_initial_state():
        for author in instance.authors.all():
            same_author_subm = User.objects.get(pk=author.pk).authored.all().exclude(
                pk=instance.pk).filter(assignment=instance.assignment)
            for subm in same_author_subm:
                subm.state = Submission.WITHDRAWN
                subm.save()
551876
protected void fireAbort(CmsUUID userId, CmsPublishJobEnqueued publishJob) {

        if (LOG.isDebugEnabled()) {
            LOG.debug(Messages.get().getBundle().key(Messages.LOG_PUBLISH_JOB_ABORT_0));
        }
        for (Iterator<I_CmsPublishEventListener> it = iterator(); it.hasNext();) {
            I_CmsPublishEventListener listener = it.next();
            try {
                listener.onAbort(userId, publishJob);
            } catch (Throwable t) {
                // catch every thing including runtime exceptions
                if (LOG.isErrorEnabled()) {
                    LOG.error(
                        Messages.get().getBundle().key(
                            Messages.ERR_PUBLISH_JOB_ABORT_ERROR_1,
                            listener.getClass().getName()),
                        t);
                }
                if (publishJob.m_publishJob.getPublishReport() != null) {
                    publishJob.m_publishJob.getPublishReport().println(t);
                }
            }
        }
        if ((userId != null) && userId.equals(publishJob.getUserId())) {
            // prevent showing messages if the owner aborted the job by himself
            return;
        }
        // popup the abort message
        String msgText = Messages.get().getBundle(publishJob.getLocale()).key(
            Messages.GUI_PUBLISH_JOB_ABORTED_2,
            new Long(publishJob.getEnqueueTime()),
            m_publishEngine.getUser(userId).getName());
        m_publishEngine.sendMessage(publishJob.getUserId(), msgText, true);
    }
994797
def is_job_done(job_id, conn=None):
    
    result = False
    get_done = RBJ.get_all(DONE, index=STATUS_FIELD)
    for item in get_done.filter({ID_FIELD: job_id}).run(conn):
        result = item
    return result
401817
def perform_permissions_check(self, user, obj, perms):
        
        return self.request.forum_permission_handler.can_delete_post(obj, user)
1116191
def delete(self, remote):
        
        try:
            self.conn.delete(remote)
        except Exception:
            return False
        else:
            return True
768002
def delete(self, user, name):
        

        uri = self.client.remote + '/users/{}/feeds/{}'.format(user, name)

        resp = self.client.session.delete(uri)
        return resp.status_code
433826
def _check_user_parameters(self, user_parameters):
        
        if not user_parameters:
            return

        # sanity check against typos
        for key in user_parameters:
            if key not in submission_defaults:
                raise ValueError("Unknown parameter {0}".format(key))
637708
public function lock_submission($userid) {
        global $USER, $DB;
        // Need grade permission.
        require_capability('mod/assign:grade', $this->context);

        // Give each submission plugin a chance to process the locking.
        $plugins = $this->get_submission_plugins();
        $submission = $this->get_user_submission($userid, false);

        $flags = $this->get_user_flags($userid, true);
        $flags->locked = 1;
        $this->update_user_flags($flags);

        foreach ($plugins as $plugin) {
            if ($plugin->is_enabled() && $plugin->is_visible()) {
                $plugin->lock($submission, $flags);
            }
        }

        $user = $DB->get_record('user', array('id' => $userid), '*', MUST_EXIST);
        \mod_assign\event\submission_locked::create_from_user($this, $user)->trigger();
        return true;
    }
436317
def kill(self, job_id):
        
        check_jobid(job_id)

        queue = self._get_queue()
        if queue is None:
            raise QueueDoesntExist

        ret, output = self._call('%s %s' % (
                                 shell_escape(queue / 'commands/kill'),
                                 job_id),
                                 False)
        if ret == 3:
            raise JobNotFound
        elif ret != 0:
            raise RemoteCommandFailure(command='commands/kill',
                                       ret=ret)
27683
def submit(self, job):
        
        script = self._printer.generate(job)
        stdin, stdout, stderr = self._ssh.exec_command('sbatch')
        stdin.write(script)
        stdin.flush()
        stdin.channel.shutdown_write()
        return stdout.read()
370977
def post_check_request(self, check, subscribers):
        
        data = {
            'check': check,
            'subscribers': [subscribers]
        }
        self._request('POST', '/request', data=json.dumps(data))
        return True