Required paramter:
        * ``key`` - The Simplepush identification key, created by
        installing the Android App (https://simplepush.io)

    Optional parameters:
        * ``event`` - use custom ringtones and vibration patterns
963225
def notify(title, message, key, event=None, retcode=None):
    

    data = {
        'title': title if len(title) <= 20 else title[:19] + u'\u2026',
        'msg': message,
        'key': key
    }

    if event:
        data['event'] = event

    headers = {'User-Agent': USER_AGENT}

    endpoint = "https://api.simplepush.io"

    resp = requests.post(endpoint + '/send', data=data, headers=headers)

    resp.raise_for_status()
998909
function run_callbacks (object, key) {
  var callbacks = object[key];
  var callback;
  // Mark the module is ready
  // `delete module.c` is not safe
  // #135
  // Android 2.2 might treat `null` as [object Global] and equal it to true,
  // So, never confuse `null` and `false`
  object[key] = FALSE;
  while(callback = callbacks.pop()){
    callback();
  }
}
94734
def create_key(self, title, key):
        
        assert isinstance(title, (str, unicode)), title
        assert isinstance(key, (str, unicode)), key
        post_parameters = {
            "title": title,
            "key": key,
        }
        headers, data = self._requester.requestJsonAndCheck(
            "POST",
            "/user/keys",
            input=post_parameters
        )
        return github.UserKey.UserKey(self._requester, headers, data, completed=True)
1338664
def touch(key, ttl=nil)
      resp = perform(:touch, key, ttl_or_default(ttl))
      resp.nil? ? nil : true
    end
226625
function () {
            /*  determine parameters  */
            var params = $cs.params("touch", arguments, {
                name: { pos: 0, req: true, valid: "string" }
            });

            /*  simply force value to same value in order to trigger event  */
            this.value({
                name:     params.name,
                value:    this.value(params.name),
                injected: true,
                force:    true
            });
        }
427027
def _new_device_id(self, key):
        
        device_id = Id.SERVER + 1
        if key in self._key2deviceId:
            return self._key2deviceId[key]
        while device_id in self._clients:
            device_id += 1
        return device_id
886257
def add_event(self, key, event):
        """"""
        assert isinstance(key, str)
        assert isinstance(event, bytes)
        if all([char.isalnum() or char == '-' for char in key]):
            safe_key = key
        else:
            raise ValueError("Key must be alphanumeric or a dash (-):"
                             " {0}".format(key))
        safe_event = base64.encodestring(event).decode().strip()
        data = "{0}\t{1}\n".format(safe_key, safe_event)

        # Important to make a single atomic write here
        self._hasher.update(data.encode())
        self.f.write(data)
863469
def on_key_release(self, symbol, modifiers):
        
        self.example.key_event(symbol, self.keys.ACTION_RELEASE)
111533
def process_key_event(self, event_data):
        '''
        
        '''

        tag = event_data['tag']
        event_info = event_data['data']

        if event_info['act'] == 'delete':
            self.minions.pop(event_info['id'], None)
        elif event_info['act'] == 'accept':
            self.minions.setdefault(event_info['id'], {})

        self.publish_minions()
878769
def on(event, &proc)
      unless @events.has_key? event
        raise Error, "`#{event}` is not a valid event type"
      end
      event_id = new_event_key
      @events[event][event_id] = proc
      EventDescriptor.new(event, event_id)
    end
1222632
def add_listener(self, event, callback, single=False, priority=1):
        
        event_stack = self._events[event]
        event_stack.append({
            "callback": callback,
            "single": single,
            "priority": priority
        })
        event_stack.sort(key=lambda x: x['priority'])
670151
function makeKeyEvent($el) {
  // On Android, the keydown event always returns character 229, except for the
  // backspace button which works as expected. Instead, we have to listen to the
  // input event and get the last character of the typed text. Note that this
  // only works if the cursor is at the end, or if the input field gets cleared
  // after every key.

  // Note that e.keyCode is deprecated, but iOS doesn't support e.key yet.

  $el.on('keydown', (e) => {
    if (e.metaKey || e.ctrlKey) return;
    if (Browser.isAndroid && e.keyCode === 229) return;

    const key = (e.key || String.fromCharCode(e.which)).toLowerCase();
    $el.trigger('key', {code: e.keyCode, key});
  });

  if (Browser.isAndroid) {
    $el.on('input', (e) => {
      const key = e.data[e.data.length - 1].toLowerCase();
      $el.trigger('key', {code: null, key});
      $el.value = '';
    });
  }
}
1072541
def send_keyevents(self, keyevent: int) -> None:
        ''''''
        self._execute('-s', self.device_sn, 'shell',
                      'input', 'keyevent', str(keyevent))
1009181
def __onKeyEvent(self, event=None):
        
        if event is None:
            return
        key = event.guiEvent.GetKeyCode()
        if (key < wx.WXK_SPACE or  key > 255):
            return
        ckey = chr(key)
        mod  = event.guiEvent.ControlDown()
        if self.is_macosx:
            mod = event.guiEvent.MetaDown()
        if mod:
            if ckey == 'C':
                self.canvas.Copy_to_Clipboard(event)
            elif ckey == 'S':
                self.save_figure(event)
            elif ckey == 'K':
                self.configure(event)
            elif ckey == 'Z':
                self.unzoom(event)
            elif ckey == 'P':
                self.canvas.printer.Print(event)
1219639
def handle_key(self, key):
        
        try:
            func = None
            if key.is_sequence:
                try:
                    func = self.config.keymap[key.name]
                except:
                    try:
                        func = self.config.keymap[key.code]
                    except:
                        func = self.config.keymap[str(key)]
            else:
                func = self.config.keymap[str(key)]

            if func in self.valid_key_funcs:
                getattr(self, func)()
        except:
            raise
189150
def send_key(self, key):
        """"""
        if isinstance(key, Keys):
            key = key.value
        params = '<X_KeyEvent>{}</X_KeyEvent>'.format(key)
        self.soap_request(URL_CONTROL_NRC, URN_REMOTE_CONTROL,
                          'X_SendKey', params)
485031
def addsshkey(self, title, key):
        
        data = {'title': title, 'key': key}

        request = requests.post(
            self.keys_url, headers=self.headers, data=data,
            verify=self.verify_ssl, auth=self.auth, timeout=self.timeout)

        if request.status_code == 201:
            return True
        else:
            return False