Create an event on your PagerDuty account.
176366
def create(cls, data=None, api_key=None, endpoint=None, add_headers=None,
               **kwargs):
        """"""
        cls.validate(data)
        inst = cls(api_key=api_key)
        endpoint = ''
        return inst.request('POST',
                            endpoint=endpoint,
                            data=data,
                            query_params=kwargs,
                            add_headers=add_headers,
                            )
1066615
function(count) {
        var cfgPageDate = DEF_CFG.PAGEDATE.key,

        prevDate = this.cfg.getProperty(cfgPageDate),
        newDate = DateMath.add(prevDate, DateMath.YEAR, count);

        this.cfg.setProperty(cfgPageDate, newDate);
        this.resetRenderers();
        this.changePageEvent.fire(prevDate, newDate);
    }
1331914
def accept(self, event):
        """"""

        self.log('Invitation accepted:', event.__dict__, lvl=debug)
        try:
            uuid = event.data
            enrollment = objectmodels['enrollment'].find_one({
                'uuid': uuid
            })

            if enrollment is not None:
                self.log('Enrollment found', lvl=debug)
                if enrollment.status == 'Open':
                    self.log('Enrollment is still open', lvl=debug)
                    if enrollment.method == 'Invited' and self.config.auto_accept_invited:
                        enrollment.status = 'Accepted'

                        data = 'You should have received an email with your new password ' \
                               'and can now log in to the system and start to use it. <br/>' \
                               'Please change your password immediately after logging in'
                        password = std_human_uid().replace(" ", '')

                        self._create_user(enrollment.name, password, enrollment.email, enrollment.method, uuid)
                        self._send_acceptance(enrollment, password, event)
                    elif enrollment.method == 'Enrolled' and self.config.auto_accept_enrolled:
                        enrollment.status = 'Accepted'
                        data = 'Your account is now activated.'

                        self._create_user(enrollment.name, enrollment.password, enrollment.email, enrollment.method,
                                          uuid)

                        # TODO: Evaluate if sending an acceptance mail makes sense
                        # self._send_acceptance(enrollment, "", event)
                    else:
                        enrollment.status = 'Pending'
                        data = 'Someone has to confirm your enrollment ' \
                               'first. Thank you, for your patience.'
                        # TODO: Alert admin users
                    enrollment.save()

                # Reaffirm acceptance to end user, when clicking on the link multiple times
                elif enrollment.status == 'Accepted':
                    data = 'You can now log in to the system and start to use it.'
                elif enrollment.status == 'Pending':
                    data = 'Someone has to confirm your enrollment ' \
                           'first. Thank you, for your patience.'
                else:
                    self.log('Enrollment has been closed already!', lvl=warn)
                    self._fail(event)
                    return
                packet = {
                    'component': 'hfos.enrol.enrolmanager',
                    'action': 'accept',
                    'data': {True: data}
                }
                self.fireEvent(send(event.client.uuid, packet))
            else:
                self.log('No enrollment available.', lvl=warn)
                self._fail(event)
        except Exception as e:
            self.log('Error during invitation accept handling:', e, type(e),
                     lvl=warn, exc=True)
1039196
def create_event(id, category, text, extras)
      event = {}
      event['id'] = id
      event['ctime'] = Time.now.to_i * 1000
      event['category'] = category
      event['text'] = text
      event.merge!(extras) { |_key, v1, _v2| v1 }

      http_post('/events', event)
    end
168201
def _invite(self, name, method, email, uuid, event, password=""):
        """"""

        props = {
            'uuid': std_uuid(),
            'status': 'Open',
            'name': name,
            'method': method,
            'email': email,
            'password': password,
            'timestamp': std_now()
        }
        enrollment = objectmodels['enrollment'](props)
        enrollment.save()

        self.log('Enrollment stored', lvl=debug)

        self._send_invitation(enrollment, event)

        packet = {
            'component': 'hfos.enrol.enrolmanager',
            'action': 'invite',
            'data': [True, email]
        }
        self.fireEvent(send(uuid, packet))
85206
def push_event(self, evt):
        """"""
        try:
            self._push_event(evt)
        except Exception as e:
            print("Unexpected error in callback for %s: %s"
                  % (str(evt), str(e)), file=self._fd)
657636
def user_event(uid):
    
    if uid is None:
        raise ParamsError()
    r = NCloudBot()
    r.method = 'USER_EVENT'
    r.params = {'uid': uid}
    r.data = {'time': -1, 'getcounts': True, "csrf_token": ""}
    r.send()

    return r.response
1229029
def before_event(self, event):
        
        if event not in ["prev_page", "next_page"]:
            while self.history.position < self.history.size:
                self.next_page()
1009211
function sendEvent() {
        var data = {},
            eventName;
        if (++i < c) {
            if (channel.page < channel.numPages) {
                data.pages = [channel.page++];
                eventName = 'pageavailable.svg';
            } else {
                eventName = 'finished.svg';
                data = '';
            }
            response.write('id: ' + i + '\n');
            response.write('event: ' + eventName + '\n');
            response.write('data: ' + (data ? JSON.stringify(data) : '') + '\n\n');
            timeoutId = setTimeout(sendEvent, (Math.random() * 1000 + 50));
        } else {
            response.end();
        }
    }
773015
function create(pageIndex) {
      var debug = document.createElement('div');
      debug.id = 'stepper' + pageIndex;
      debug.setAttribute('hidden', true);
      debug.className = 'stepper';
      stepperDiv.appendChild(debug);
      var b = document.createElement('option');
      b.textContent = 'Page ' + (pageIndex + 1);
      b.value = pageIndex;
      stepperChooser.appendChild(b);
      var initBreakPoints = breakPoints[pageIndex] || [];
      var stepper = new Stepper(debug, pageIndex, initBreakPoints);
      steppers.push(stepper);
      if (steppers.length === 1) {
        this.selectStepper(pageIndex, false);
      }
      return stepper;
    }
156665
def events_login(self):
        
        # TODO Add paging to this
        response = self._get(url.events_logins)
        return self._create_response(response).get("events")
1308416
def _page_update(self, event):
        
        try:
            if event.schema == 'wikipage':
                self._update_index()

        except Exception as e:
            self.log("Page creation notification error: ", event, e,
                     type(e), lvl=error)
978413
def _make_event(self, event_type, code, value):
        """"""
        secs, msecs = convert_timeval(time.time())
        data = struct.pack(EVENT_FORMAT,
                           secs,
                           msecs,
                           event_type,
                           code,
                           value)
        self._write_device.write(data)
        self._write_device.flush()
888370
def _make_event(self, value):  # pylint: disable=arguments-differ
        """"""
        super(SystemLED, self)._make_event(
            self._led_type_code,
            self.code,
            value)
462307
private void publishEvent(WSJobExecution jobEx, String topicToPublish, String correlationId) {
        if (eventsPublisher != null) {
            eventsPublisher.publishJobExecutionEvent(jobEx, topicToPublish, correlationId);
        }
    }
425393
def edit_event_view(request, event_pk):
    '''  '''
    page_name = "Edit Event"
    profile = UserProfile.objects.get(user=request.user)
    event = get_object_or_404(Event, pk=event_pk)

    if event.owner != profile and not request.user.is_superuser:
        return HttpResponseRedirect(
            reverse('events:view', kwargs={"event_pk": event_pk}),
        )

    event_form = EventForm(
        request.POST or None,
        profile=profile,
        instance=event,
    )
    if event_form.is_valid():
        event = event_form.save()
        messages.add_message(
            request, messages.SUCCESS,
            MESSAGES['EVENT_UPDATED'].format(event=event.title),
        )
        return HttpResponseRedirect(
            reverse('events:view', kwargs={"event_pk": event_pk}),
        )

    return render_to_response('edit_event.html', {
        'page_name': page_name,
        'event_form': event_form,
    }, context_instance=RequestContext(request))
1016972
function createIeEvent(type, options) {
  options = clean(type, options);
  var e = document.createEventObject();
  e.altKey = options.alt;
  e.bubbles = options.bubbles;
  e.button = options.button;
  e.cancelable = options.cancelable;
  e.clientX = options.clientX;
  e.clientY = options.clientY;
  e.ctrlKey = options.ctrl;
  e.detail = options.detail;
  e.metaKey = options.meta;
  e.screenX = options.screenX;
  e.screenY = options.screenY;
  e.shiftKey = options.shift;
  e.keyCode = options.key;
  e.charCode = options.key;
  e.view = options.view;
  return e;
}