Handle actions on a timeline_item with a given id (custom actions, delete, etc.)
352042
def handle_action
      timeline_item = find_timeline_item(self.glass_item_id)

      # TODO: Should we uniq these? When glass doesn't have connection, it will queue up
      # actions, so users might press the same one multiple times.
      user_actions.uniq.each do |user_action|
        type = user_action[:type] == "CUSTOM" ? user_action[:payload] : user_action[:type]
        json_to_return = self.reply_request_hash ? self.reply_request_hash : self.params
        timeline_item.send("handles_#{type.downcase}", json_to_return)
      end if user_actions
    end
1151073
def handler(event, context):  # pylint: disable=W0613
    
    records = deserialize_records(event['Records'])

    # Split records into two groups, update and delete.
    # We don't want to query for deleted records.
    update_records, delete_records = group_records_by_type(records, UPDATE_EVENTS)

    LOG.debug('[@] Processing update records...')
    process_update_records(update_records)
    LOG.debug('[@] Completed processing of update records.')

    LOG.debug('[@] Processing delete records...')
    process_delete_records(delete_records)
    LOG.debug('[@] Completed processing of delete records.')

    LOG.debug('[@] Successfully updated current Historical table')
1135026
function cancel_item(itemId, customParams, callback) {
      var _doArgs51 = doArgs(arguments, ['string|number', ['object', {}], 'function']);

      var _doArgs52 = _slicedToArray(_doArgs51, 3);

      itemId = _doArgs52[0];
      customParams = _doArgs52[1];
      callback = _doArgs52[2];


      customParams.id = itemId;

      doRequest({
        method: 'POST',
        urlPattern: [QUEUE_CANCEL_ITEM]
      }, customParams, callback);
    }
460538
def handler(event, context):
    
    records = deserialize_records(event['Records'])

    # Split records into two groups, update and delete.
    # We don't want to query for deleted records.
    update_records, delete_records = group_records_by_type(records)
    capture_delete_records(delete_records)

    # filter out error events
    update_records = [e for e in update_records if not e['detail'].get('errorCode')]

    # group records by account for more efficient processing
    log.debug('Update Records: {records}'.format(records=records))

    capture_update_records(update_records)
370614
def _hook_id(self, info):
        
        if isinstance(info, dict) and 'id' in info.keys():
            self.id = info['id']
933275
def _handle_delete(self, method, remainder, request=None):
        '''
        
        '''
        if request is None:
            self._raise_method_deprecation_warning(self._handle_delete)

        if remainder:
            match = self._handle_custom_action(method, remainder, request)
            if match:
                return match

            controller = self._lookup_child(remainder[0])
            if controller and not ismethod(controller):
                return lookup_controller(controller, remainder[1:], request)

        # check for post_delete/delete requests first
        controller = self._find_controller('post_delete', 'delete')
        if controller:
            return controller, remainder

        # if no controller exists, try routing to a sub-controller; note that
        # since this is a DELETE verb, any local exposes are 405'd
        if remainder:
            if self._find_controller(remainder[0]):
                abort(405)
            sub_controller = self._lookup_child(remainder[0])
            if sub_controller:
                return lookup_controller(sub_controller, remainder[1:],
                                         request)

        abort(405)
1121855
function (id, callback) {
        var todos = data.todos;

        for (var i = 0; i < todos.length; i++) {
          if (todos[i].id == id) {
            todos.splice(i, 1);
            break;
          }
        }

        flush();
        callback.call(undefined, data.todos);
      }
698198
def handle(self, dict):
        '''
        
        '''
        # format key
        key = "zk:{action}:{domain}:{appid}".format(
                action=dict['action'],
                appid=dict['appid'],
                domain=dict['domain'])

        d = {"domain": dict['domain'], "uuid": dict['uuid']}

        if dict['action'] == 'domain-update':
            if dict['hits'] != 0 and dict['window'] != 0:
                d["hits"] = dict['hits']
                d['scale'] = dict['scale']
                d['window'] = dict['window']
            else:
                self.logger.error("'hits' and 'window' not set for domain update")
                return None

        value = ujson.dumps(d)

        self.redis_conn.set(key, value)

        dict['parsed'] = True
        dict['valid'] = True
        self.logger.info('Added zookeeper action to Redis', extra=dict)
848640
def handle_intermediate_response(self, item_session: ItemSession) -> Actions:
        '''
        '''
        self._waiter.reset()

        action = self.handle_response(item_session)

        return action
324244
def hook_action(action, repo_id):
    """"""
    github = GitHubAPI(user_id=current_user.id)
    repos = github.account.extra_data['repos']

    if repo_id not in repos:
        abort(404)

    if action == 'disable':
        if github.remove_hook(repo_id, repos[repo_id]['full_name']):
            db.session.commit()
            return redirect(url_for('.index'))
        else:
            abort(400)
    elif action == 'enable':
        if github.create_hook(repo_id, repos[repo_id]['full_name']):
            db.session.commit()
            return redirect(url_for('.index'))
        else:
            abort(400)
    else:
        abort(400)
658674
def scoped_timeline(self, *id, **kwargs):
        
        self._validate_loaded()

        params = {'user_id': id}
        params.update(kwargs)

        resource = self.SCOPED_TIMELINE.format(id=self.id)
        response = Request(self.client, 'get', resource, params=params).perform()

        return response.body['data']
1102818
def post_event(id, event, options = {})
      data = options
      data['id'] = id
      data['event'] = event
      api_post(:event, data)
    end
742080
def handle_pre_response(self, item_session: ItemSession) -> Actions:
        ''''''
        action = self.consult_pre_response_hook(item_session)

        if action == Actions.RETRY:
            item_session.set_status(Status.skipped)
        elif action == Actions.FINISH:
            item_session.set_status(Status.done)
        elif action == Actions.STOP:
            raise HookStop('Script requested immediate stop.')

        return action
382657
def trigger_delete_by_id(self, id, **kwargs):
        ""
        api_path = "/api/v2/triggers/{id}.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, method="DELETE", **kwargs)
767005
def delete(self, id, id_name='id', **kwargs):
        
        response = self._new_response()
        if self._check_supported_op('delete', response):
            params = {'Key': {id_name: id}}
            self._call_ddb_method(self.table.delete_item, params, response)
            response.data = 'true'
        response.prepare()
        return response
107177
def _handle_events(self, fd: int, events: int) -> None:
        
        action = 0
        if events & ioloop.IOLoop.READ:
            action |= pycurl.CSELECT_IN
        if events & ioloop.IOLoop.WRITE:
            action |= pycurl.CSELECT_OUT
        while True:
            try:
                ret, num_handles = self._multi.socket_action(fd, action)
            except pycurl.error as e:
                ret = e.args[0]
            if ret != pycurl.E_CALL_MULTI_PERFORM:
                break
        self._finish_pending_requests()
1132315
function(id) {
        var item = Selectivity.findNestedById(this.results, id);
        if (item && !item.disabled && item.selectable !== false) {
            var options = { id: id, item: item };
            if (this.selectivity.triggerEvent('selectivity-selecting', options)) {
                this.selectivity.triggerEvent('selectivity-selected', options);
            }
        }
    }