Dispatches a GET request to /events of the API to get a set of recent changes to a resource.
514430
def get(self, params, **options):
        """"""
        options = self.client._merge_options({ 'full_payload': True })
        return self.client.get('/events', params, **options)
1185881
def dispatch(self, **changes):
        
        self.patch(**changes)
        trigger_url = self._vr._build_url(self.resource_uri, 'swarm/')
        resp = self._vr.session.post(trigger_url)
        resp.raise_for_status()
        try:
            return resp.json()
        except ValueError:
            return None
559772
def _requests(self, url, method='GET', headers=None, params=None, data=None, errors=None):

        '''  '''

        title = '%s._requests' % self.__class__.__name__
    
    # import dependencies
        from time import time
        import requests

    # validate access token
        if not self._access_token:
            self.access_token()
            if self.retrieve_details:
                self._get_products()
    
    # refresh token
        current_time = time()
        if current_time > self.expires_at:
            self.access_token()
            if self.retrieve_details:
                self._get_products()

    # construct request kwargs
        request_kwargs = {
            'url': url,
            'headers': { 
                'Authorization': 'Bearer %s' % self._access_token,
                'Accept': 'application/json;v=2'
            },
            'params': {},
            'data': {}
        }
        if headers:
            request_kwargs['headers'].update(headers)
        if params:
            request_kwargs['params'].update(params)
        if data:
            request_kwargs['data'].update(data)

    # send request
        if method == 'POST':
            try:
                response = requests.post(**request_kwargs)
            except Exception:
                if self.requests_handler:
                    request_kwargs['method'] = 'POST'
                    request_object = requests.Request(**request_kwargs)
                    return self.requests_handler(request_object)
                else:
                    raise
        elif method == 'GET':
            try:
                response = requests.get(**request_kwargs)
            except Exception:
                if self.requests_handler:
                    request_kwargs['method'] = 'GET'
                    request_object = requests.Request(**request_kwargs)
                    return self.requests_handler(request_object)
                else:
                    raise
        else:
            raise ValueError('%s(method='') must be either GET or POST' % title)

    # handle response
        response_details = self.response_handler.handle(response, errors)
        
        return response_details
878152
async def getUpdates(self,
                         offset=None,
                         limit=None,
                         timeout=None,
                         allowed_updates=None):
        
        p = _strip(locals())
        return await self._api_request('getUpdates', _rectify(p))
423715
def on_get(self, req, resp, **kwargs):
        """"""
        return super().on_get(
            req, resp, handler=self._retrieve, **kwargs
        )
212812
def last_event(request, slug):
    ""
    
    try:
        service = Service.objects.get(slug=slug)
    except Service.DoesNotExist:
        return HttpResponseRedirect(reverse('overseer:index'))
    
    try:
        evt = service.event_set.order_by('-date_created')[0]
    except IndexError:
        return HttpResponseRedirect(service.get_absolute_url())
    
    return event(request, evt.pk)
896094
def get_updates(self, offset=None, limit=None, timeout=None):
        
        payload = dict(offset=offset, limit=limit, timeout=timeout)
        return self._get('getUpdates', payload)
611494
def on_get(self, req, resp, **kwargs):
        """"""
        return super().on_get(req, resp, handler=self._list, **kwargs)
188819
def dispatch(self, operation, request, **path_args):
        
        # Add current operation to the request (for convenience in middleware methods)
        request.current_operation = operation

        try:
            for middleware in self.middleware.pre_request:
                response = middleware(request, path_args)
                # Return HttpResponse if one is returned.
                if isinstance(response, HttpResponse):
                    return response

            response = self._dispatch(operation, request, path_args)

            for middleware in self.middleware.post_request:
                response = middleware(request, response)

        except Exception as ex:
            if self.debug_enabled:
                # If debug is enabled then fallback to the frameworks default
                # error processing, this often provides convenience features
                # to aid in the debugging process.
                raise
            self.handle_500(request, ex)
            return HttpResponse("Error processing response.", HTTPStatus.INTERNAL_SERVER_ERROR)

        else:
            return response
327324
def dispatch(self, request, *args, **kwargs):
        
        allowed_methods = self.get_allowed_methods()
        try:
            if request.method == 'GET' and 'GET' in allowed_methods:
                if 'pk' in request.GET or self.slug_field in request.GET:
                    return self.ng_get(request, *args, **kwargs)
                return self.ng_query(request, *args, **kwargs)
            elif request.method == 'POST' and 'POST' in allowed_methods:
                return self.ng_save(request, *args, **kwargs)
            elif request.method == 'DELETE' and 'DELETE' in allowed_methods:
                return self.ng_delete(request, *args, **kwargs)
        except self.model.DoesNotExist as e:
            return self.error_json_response(e.args[0], 404)
        except NgMissingParameterError as e:
            return self.error_json_response(e.args[0])
        except JSONResponseException as e:
            return self.error_json_response(e.args[0], e.status_code)
        except ValidationError as e:
            if hasattr(e, 'error_dict'):
                return self.error_json_response('Form not valid', detail=e.message_dict)
            else:
                return self.error_json_response(e.message)

        return self.error_json_response('This view can not handle method {0}'.format(request.method), 405)
1258276
function onFetch(event) {
  // Make sure this is a request we should be handling in the first place.
  // If it's not, it's important to leave it alone and not call respondWith.
  let useCache = false;
  for (const prefix of CACHEABLE_URL_PREFIXES) {
    if (event.request.url.startsWith(prefix)) {
      useCache = true;
      break;
    }
  }

  // Now we need to check our resource lists.  The list of prefixes above won't
  // cover everything that was installed initially, and those things still need
  // to be read from cache.  So we check if this request URL matches one of
  // those lists.
  // The resource lists contain some relative URLs and some absolute URLs.  The
  // check here will only be able to match the absolute ones, but that's enough,
  // because the relative ones are covered by the loop above.
  if (!useCache) {
    if (CRITICAL_RESOURCES.includes(event.request.url) ||
        OPTIONAL_RESOURCES.includes(event.request.url)) {
      useCache = true;
    }
  }

  if (useCache) {
    event.respondWith(fetchCacheableResource(event.request));
  }
}
656392
def get_events(**kwargs):
    
    url = "/r25ws/servlet/wrd/run/events.xml"
    if len(kwargs):
        url += "?%s" % urlencode(kwargs)

    return events_from_xml(get_resource(url))
1280547
def get_changes(self, remove=True, only_current=False, resources=None,
                    task_handle=taskhandle.NullTaskHandle()):
        
        changes = ChangeSet('Inline method <%s>' % self.name)
        if resources is None:
            resources = self.project.get_python_files()
        if only_current:
            resources = [self.original]
            if remove:
                resources.append(self.resource)
        job_set = task_handle.create_jobset('Collecting Changes',
                                            len(resources))
        for file in resources:
            job_set.started_job(file.path)
            if file == self.resource:
                changes.add_change(self._defining_file_changes(
                    changes, remove=remove, only_current=only_current))
            else:
                aim = None
                if only_current and self.original == file:
                    aim = self.offset
                handle = _InlineFunctionCallsForModuleHandle(
                    self.project, file, self.others_generator, aim)
                result = move.ModuleSkipRenamer(
                    self.occurrence_finder, file, handle).get_changed_module()
                if result is not None:
                    result = _add_imports(self.project, result,
                                          file, self.imports)
                    if remove:
                        result = _remove_from(self.project, self.pyname,
                                              result, file)
                    changes.add_change(ChangeContents(file, result))
            job_set.finished_job()
        return changes
809540
def get_events(self):
        
        return github.PaginatedList.PaginatedList(
            github.IssueEvent.IssueEvent,
            self._requester,
            self.url + "/events",
            None,
            headers={'Accept': Consts.mediaTypeLockReasonPreview}
        )
164927
def get_events(self):
        """"""
        to_send = {'limit': 50}
        response = self._send_data('POST', 'admin', 'get-events', to_send)

        output = {'message': ""}
        for event in response['events']:
            desc = "Source IP: {ip}\n"
            desc += "Datetime: {time}\n"
            desc += "Indicator: {match}\n"
            desc += "Method: {method}\n"
            desc += "URL: {url}\n"
            desc += "Request Type: {type}\n"
            desc += "User-Agent: {userAgent}\n"
            desc += "Contact: {contact}\n"
            desc += "\n"
            output['message'] += desc.format(**event)

        return output
770004
def get_event(self, client, check):
        
        data = self._request('GET', '/events/{}/{}'.format(client, check))
        return data.json()
922054
def update
      respond_to do |wants|
        result = resource_get.update_attributes(resource_params)
        call_hook :after_update_attributes, result
        if result
          flash[:notice] = t 'messages.record_updated', model: t("models.#{resource_name}")
          wants.html { redirect_to(resource_get) }
          wants.json  { head :ok }
        else
          wants.html { render :action => "edit" }
          wants.json  { render :json => resource_get.errors, :status => :unprocessable_entity }
        end
      end
    end