Handle %edit magic petitions.
323632
def edit_file(self, filename, line):
        """"""
        if encoding.is_text_file(filename):
            # The default line number sent by ipykernel is always the last
            # one, but we prefer to use the first.
            self.edit_goto.emit(filename, 1, '')
980309
def update(self, request, *args, **kwargs):
        
        instance = self.get_object()
        if (not request.user.has_perm('edit_collection', instance.collection)
                and not request.user.is_superuser):
            return Response(status=status.HTTP_401_UNAUTHORIZED)

        return super().update(request, *args, **kwargs)
520960
def handle_update(self, action, params):
    """"""
    _LOGGER.debug('Keypad: "%s" %s Action: %s Params: %s"' % (
                  self._keypad.name, self, action, params))
    ev_map = {
        Button._ACTION_PRESS: Button.Event.PRESSED,
        Button._ACTION_RELEASE: Button.Event.RELEASED
    }
    if action not in ev_map:
      _LOGGER.debug("Unknown action %d for button %d in keypad %d" % (
          action, self.number, self.keypad.name))
      return False
    self._dispatch_event(ev_map[action], {})
    return True
998056
void submit() {

        try {
            List<CmsUUID> modifiedResources = undelete();
            m_context.finish(modifiedResources);
        } catch (Exception e) {
            m_context.error(e);
        }
    }
1277938
private void tryCommit()
    {
        try
        {
            JComponent editor = spinner.getEditor();
            if (editor instanceof JSpinner.DefaultEditor)
            {
                JSpinner.DefaultEditor defaultEditor =
                    (JSpinner.DefaultEditor)editor;
                defaultEditor.commitEdit();
            }
        }
        catch (ParseException e1)
        {
            // Ignored
        }
    }
276346
def editor(*args, **kwargs):
    '''
    
    '''
    result = click.edit(*args, **kwargs)
    if result is None:
        msg = 'Editor exited without saving, command aborted'
        raise click.ClickException(msg)
    return result
1197766
def edit_resource(self, request):
        
        self.location_query = request.uri_query
        self.payload = (request.content_type, request.payload)
422502
def edit_manager_view(request, managerTitle):
    ''' 
    '''
    targetManager = get_object_or_404(Manager, url_title=managerTitle)
    form = ManagerForm(
        request.POST or None,
        instance=targetManager,
        )
    if form.is_valid():
        manager = form.save()
        messages.add_message(request, messages.SUCCESS,
                             MESSAGES['MANAGER_SAVED'].format(managerTitle=manager.title))
        return HttpResponseRedirect(reverse('managers:meta_manager'))
    return render_to_response('edit_manager.html', {
        'page_name': "Admin - Edit Manager",
        'form': form,
        "managerset": Manager.objects.all(),
        'manager_title': targetManager.title,
        }, context_instance=RequestContext(request))
1305772
def edit(self, **kwargs):
        
        response = self._requester.request(
            'PUT',
            'calendar_events/{}'.format(self.id),
            _kwargs=combine_kwargs(**kwargs)
        )

        if 'title' in response.json():
            super(CalendarEvent, self).set_attributes(response.json())

        return CalendarEvent(self._requester, response.json())
513818
function (delta) {
            edits.push.apply(edits, delta.edits);
            moves.push.apply(moves, delta.moves);
            queue.push.apply(queue, delta.newElements);
        }
654852
function handlePermissions(options) {
            return canThis(options.context).edit.user(options.data.password[0].user_id).then(() => {
                return options;
            }).catch((err) => {
                return Promise.reject(new common.errors.NoPermissionError({
                    err: err,
                    context: common.i18n.t('errors.api.users.noPermissionToChangeUsersPwd')
                }));
            });
        }
826243
def edit_command(self, payload):
        """"""
        key = payload['key']
        command = payload['command']
        if self.queue[key]:
            if self.queue[key]['status'] in ['queued', 'stashed']:
                self.queue[key]['command'] = command
                answer = {'message': 'Command updated', 'status': 'error'}
            else:
                answer = {'message': "Entry is not 'queued' or 'stashed'",
                          'status': 'error'}
        else:
            answer = {'message': 'No entry with this key', 'status': 'error'}

        # Pause all processes and the daemon
        return answer
1276477
def edit(self, sha, force=github.GithubObject.NotSet):
        
        assert isinstance(sha, (str, unicode)), sha
        assert force is github.GithubObject.NotSet or isinstance(force, bool), force
        post_parameters = {
            "sha": sha,
        }
        if force is not github.GithubObject.NotSet:
            post_parameters["force"] = force
        headers, data = self._requester.requestJsonAndCheck(
            "PATCH",
            self.url,
            input=post_parameters
        )
        self._useAttributes(data)
5673
def update_callback(self, handle, events):
        """"""
        if self._poll is None:
            raise RuntimeError('poll instance is closed')
        if not has_callback(self, handle):
            raise ValueError('no such callback')
        if events & ~(READABLE|WRITABLE):
            raise ValueError('illegal event mask: {}'.format(events))
        if handle.extra == events:
            return
        if handle.extra & READABLE:
            self._readers -= 1
        if handle.extra & WRITABLE:
            self._writers -= 1
        if events & READABLE:
            self._readers += 1
        if events & WRITABLE:
            self._writers += 1
        handle.extra = events
        self._sync()
967519
public void requestModificationLock() {
    lock.readLock().lock();
    if (!veto)
      return;

    if (throwException) {
      lock.readLock().unlock();
      throw new OModificationOperationProhibitedException("Modification requests are prohibited");
    }

    boolean wasInterrupted = false;
    Thread thread = Thread.currentThread();
    waiters.add(thread);

    while (veto) {
      LockSupport.park(this);
      if (Thread.interrupted())
        wasInterrupted = true;
    }

    waiters.remove(thread);
    if (wasInterrupted)
      thread.interrupt();
  }
1228246
def run(self, value, errors, request):
        """"""
        thing = super(EditableDBThing, self).run(value, errors, request)
        if errors:
            return None
        if not thing.can_edit(request.user):
            message = 'Insufficient permissions for {0}'.format(self.param)
            raise HTTPForbidden(message)
        return thing
242998
def to_modify(self, uid):
        '''
        
        '''
        if self.userinfo.role[1] >= '3':
            pass
        else:
            return False

        self.render('misc/link/link_edit.html',
                    kwd={},
                    postinfo=MLink.get_by_uid(uid),
                    userinfo=self.userinfo)