Called from the management screen.
175698
@RequirePOST
    public HttpResponse doAct(StaplerRequest req) throws ServletException, IOException {
        Jenkins.getInstance().checkPermission(Jenkins.ADMINISTER);

        if(req.hasParameter("n")) {
            // we'll shut up
            disable(true);
            return HttpResponses.redirectViaContextPath("/manage");
        }

        return new HttpRedirect("confirm");
    }
436100
def action a
      text a.name
      mnemonic a.mnemonic unless a.mnemonic.nil?
      command { a.call }
    end
1141949
private void initManagementPart() {

        m_manageExceptionsButton.setText(Messages.get().key(Messages.GUI_SERIALDATE_BUTTON_MANAGE_EXCEPTIONS_0));
        m_manageExceptionsButton.getElement().getStyle().setFloat(Style.Float.RIGHT);
    }
1053683
def get(self):
        """"""
        new = self.manager.get(self)
        if new:
            self._add_details(new._info)
858612
private void processNewEdge(int role, int b) {
        final RoleSet roleClosure = getRoleClosure(role);
        processRole(role, b);
        for (int s = roleClosure.first(); s >= 0; s = roleClosure.next(s + 1)) {
            if (s == role)
                continue;
            processRole(s, b);
        }
    }
709256
def assert_order_met(self, finalize=False):
        """"""
        error = None
        actual_call_len = len(self._actual_calls)
        expected_call_len = len(self._call_order)

        if actual_call_len == 0:
            error = "Not enough calls were made"
        else:
            for i,call in enumerate(self._call_order):
                if actual_call_len < i+1:
                    if not finalize:
                        # we're not done asserting calls so
                        # forget about not having enough calls
                        continue

                    calls_made = len(self._actual_calls)
                    if calls_made == 1:
                        error = "Only 1 call was made"
                    else:
                        error = "Only %s calls were made" % calls_made
                    break

                ac_call = self._actual_calls[i]
                if ac_call is not call:
                    error = "Call #%s was %r" % (i+1, ac_call)
                    break

            if not error:
                if actual_call_len > expected_call_len:
                    # only show the first extra call since this
                    # will be triggered before all calls are finished:
                    error = "#%s %s was unexpected" % (
                        expected_call_len+1,
                        self._actual_calls[expected_call_len]
                    )

        if error:
            msg = "%s; Expected: %s" % (
                    error, self._repr_call_list(self._call_order))
            raise AssertionError(msg)
503964
def manage(self):
        
        log = self._params.get('log', self._discard)
        if self._stopping:
            log.debug("Task '%s', stopping, retrying stop()", self._name)
            return self.stop()
        now = time.time()
        if self._started and self._limit:
            if now > self._limit:
                log.debug("Task '%s', time limit exceeded by %s, stopping", self._name, deltafmt(now - self._limit))
                return self.stop()
            else:
                log.debug("Task '%s', time limit remaining %s", self._name, deltafmt(self._limit - now))
        if self._legion.is_exiting():
            log.debug("Not managing '%s', legion is exiting", self._name)
            return False
        log.debug("managing '%s'", self._name)
        return self._start()
965666
function(status, xhr, settings) {
		settings.complete.call(settings.context, xhr, status);
	}
1135364
def manage_actors(self, monitor, stop=False):
        '''
        '''
        alive = 0
        if self.managed_actors:
            for aid, actor in list(self.managed_actors.items()):
                alive += self.manage_actor(monitor, actor, stop)
        return alive
1110433
function _errorOnCall(config, err) {
    const errorResult = manageResponseErrors(err, config);
    _dispatchFieldErrors(config, errorResult.fields);
}
1373549
def main(ctx, connection):
    """"""
    ctx.obj = Manager(connection=connection)
    ctx.obj.bind()
1160826
def cmd_screen(action, action_space, ability_id, queued, screen):
  """"""
  action_cmd = spatial(action, action_space).unit_command
  action_cmd.ability_id = ability_id
  action_cmd.queue_command = queued
  screen.assign_to(action_cmd.target_screen_coord)
1302858
def handle(self, *args, **opt):
        
        d1_gmn.app.management.commands.util.util.log_setup(opt["debug"])
        logging.info(
            "Running management command: {}".format(
                __name__
            )  # util.get_command_name())
        )
        d1_gmn.app.management.commands.util.util.exit_if_other_instance_is_running(
            __name__
        )
        self._opt = opt
        try:
            # profiler = profile.Profile()
            # profiler.runcall(self._handle)
            # profiler.print_stats()
            self._handle()
        except d1_common.types.exceptions.DataONEException as e:
            logging.error(str(e))
            raise django.core.management.base.CommandError(str(e))
        self._events.dump_to_log()
1206729
def manager_view(request, managerTitle):
    ''' 
    '''
    targetManager = get_object_or_404(Manager, url_title=managerTitle)

    if not targetManager.active:
        messages.add_message(request, messages.ERROR, MESSAGES['INACTIVE_MANAGER'].format(managerTitle=targetManager.title))
        return HttpResponseRedirect(reverse('managers:list_managers'))
    else:
        return render_to_response('view_manager.html', {
            'page_name': "View Manager",
            'targetManager': targetManager,
            }, context_instance=RequestContext(request))
1350196
@Override
    public void taskStopping() {
        SecWorkContextHandler.getInstance().dissociate();
        subjectManager.setCallerSubject(priorCallerSubject);
        subjectManager.setInvocationSubject(priorInvocationSubject);
    }
844112
def handle(self, **options):
        """"""

        with open('eighth_absentees.csv', 'r') as absopen:
            absences = csv.reader(absopen)
            for row in absences:
                bid, uid = row
                try:
                    usr = User.objects.get(id=uid)
                except User.DoesNotExist:
                    self.stdout.write("User {} doesn't exist, bid {}".format(usr, bid))
                else:
                    try:
                        blk = EighthBlock.objects.get(id=bid)
                    except EighthBlock.DoesNotExist:
                        self.stdout.write("Block {} doesn't exist, with user {}".format(bid, uid))
                    else:
                        usr_signup = EighthSignup.objects.filter(user=usr, scheduled_activity__block=blk)
                        self.stdout.write("{} signup: {}".format(usr, usr_signup))
                        if usr_signup.count() == 0:
                            other_abs_act, _ = EighthActivity.objects.get_or_create(name="z-OTHER ABSENCE (transferred from Iodine)",
                                                                                    administrative=True)
                            other_abs_sch, _ = EighthScheduledActivity.objects.get_or_create(block=blk, activity=other_abs_act)
                            other_abs_su = EighthSignup.objects.create(user=usr, scheduled_activity=other_abs_sch, was_absent=True)
                            self.stdout.write("{} Signup on {} created: {}".format(usr, bid, other_abs_su))
                        else:
                            s = usr_signup[0]
                            s.was_absent = True
                            s.save()
                            sa = s.scheduled_activity
                            sa.attendance_taken = True
                            sa.save()
                            self.stdout.write("{} Signup on {} modified: {}".format(usr, bid, usr_signup[0]))

        self.stdout.write("Done.")
1298658
private function _call()
    {

        // Time this
        $t = new Timer('CUPS extension');

        // Deal with calling it
        try {
            $result = $this->_CallExt->exec('lpstat', '-p -o -l');
        } catch (Exception $e) {
            // messed up somehow
            Errors::add('CUPS Extension', $e->getMessage());
            $this->_res = false;

            // Don't bother going any further
            return false;
        }

        // Split it into lines
        $lines = explode("\n", $result);

        // Hold temporarily values here
        $printers = [];
        $queue = [];
        $begin_queue_list = false;

        // Go through it line by line
        for ($i = 0, $num = count($lines); $i < $num; ++$i) {

            // So regexes don't break on endlines
            $lines[$i] = trim($lines[$i]);

            // If there are no entries, don't waste time and end here
            if ($lines[$i] == 'no entries') {
                break;
            } elseif (preg_match('/^printer (.+) is idle\. (.+)$/', $lines[$i], $printers_match) == 1) {
                $printers[] = array(
                    'name' => str_replace('_', ' ', $printers_match[1]),
                    'status' => $printers_match[2],
                );
            }

            // A printer entry
            elseif (preg_match('/^(.+)+ is (ready|ready and printing|not ready)$/', $lines[$i], $printers_match) == 1) {
                $printers[] = array(
                    'name' => str_replace('_', ' ', $printers_match[1]),
                    'status' => $printers_match[2],
                );
            }

            // The beginning of the queue list
            elseif (preg_match('/^Rank\s+Owner\s+Job\s+File\(s\)\s+Total Size$/', $lines[$i])) {
                $begin_queue_list = true;
            }

            // A job in the queue
            elseif ($begin_queue_list && preg_match('/^([a-z0-9]+)\s+(\S+)\s+(\d+)\s+(.+)\s+(\d+) bytes$/', $lines[$i], $queue_match)) {
                $queue[] = array(
                    'rank' => $queue_match[1],
                    'owner' => $queue_match[2],
                    'job' => $queue_match[3],
                    'files' => $queue_match[4],
                    'size' => Common::byteConvert($queue_match[5]),
                );
            }
        }

        // Save result lset
        $this->_res = array(
            'printers' => $printers,
            'queue' => $queue,
        );

        // Apparent success
        return true;
    }