Listen for update notifications for the auth storage
343147
@POST
  @Path("/listen/{authenticatorName}")
  @Produces(MediaType.APPLICATION_JSON)
  @Consumes(MediaType.APPLICATION_JSON)
  @ResourceFilters(BasicSecurityResourceFilter.class)
  public Response authenticatorUpdateListener(
      @Context HttpServletRequest req,
      @PathParam("authenticatorName") final String authenticatorName,
      byte[] serializedUserMap
  )
  {
    return handler.authenticatorUpdateListener(authenticatorName, serializedUserMap);
  }
295502
def _notifications(self):
        
        if not self.username or not self.auth_token:
            if not self.notification_warning:
                self.py3.notify_user(
                    "Github module needs username and "
                    "auth_token to check notifications."
                )
                self.notification_warning = True
            return "?"
        if self.notifications == "all" or not self.repo:
            url = self.url_api + "/notifications"
        else:
            url = self.url_api + "/repos/" + self.repo + "/notifications"
        url += "?per_page=100"
        try:
            info = self.py3.request(url, auth=(self.username, self.auth_token))
        except (self.py3.RequestException):
            return
        if info.status_code == 200:
            links = info.headers.get("Link")

            if not links:
                return len(info.json())

            last_page = 1
            for link in links.split(","):
                if 'rel="last"' in link:
                    last_url = link[link.find("<") + 1 : link.find(">")]
                    parsed = urlparse.urlparse(last_url)
                    last_page = int(urlparse.parse_qs(parsed.query)["page"][0])

            if last_page == 1:
                return len(info.json())
            try:
                last_page_info = self.py3.request(
                    last_url, auth=(self.username, self.auth_token)
                )
            except self.py3.RequestException:
                return

            return len(info.json()) * (last_page - 1) + len(last_page_info.json())

        if info.status_code == 404:
            if not self.repo_warning:
                self.py3.notify_user("Github repo cannot be found.")
                self.repo_warning = True
329031
void notifyListener() {
        Node<K, V> node;
        while ((node = pendingNotifications.poll()) != null) {
            listener.onEviction(node.key, node.getValue());
        }
    }
296854
def apps_notify_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/apps/notify.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
1072547
function notify(listener) {
    var func = state == webdriver.promise.Deferred.State_.RESOLVED ?
        listener.callback : listener.errback;
    if (func) {
      flow.runInNewFrame_(goog.partial(func, value),
          listener.fulfill, listener.reject);
    } else if (state == webdriver.promise.Deferred.State_.REJECTED) {
      listener.reject(value);
    } else {
      listener.fulfill(value);
    }
  }
1052912
function createCustomNotification(notification) {
    if (!notification) {
        return Promise.resolve();
    }

    return Promise.each(notification.messages, function (message) {
        let toAdd = {
            // @NOTE: the update check service returns "0" or "1" (https://github.com/TryGhost/UpdateCheck/issues/43)
            custom: !!notification.custom,
            createdAt: moment(notification.created_at).toDate(),
            status: message.status || 'alert',
            type: message.type || 'info',
            id: message.id,
            dismissible: message.hasOwnProperty('dismissible') ? message.dismissible : true,
            top: !!message.top,
            message: message.content
        };

        debug('Add Custom Notification', toAdd);
        return api.notifications.add({notifications: [toAdd]}, {context: {internal: true}});
    });
}
678924
function setUpdateListener() {

  signal.addListener(SIGNAL_KEY, function (err, params) {

    exports.update(params.domain, params.collection, function () {

      log.debug('The received signal to update the cache. ' + params.collection);

      rider.reset(params.collection);
    });
  });
}
1010321
async function getNotifications(config) {
  try {
    const options = {
      method: "GET",
      uri: `${config.obServer}:${config.obPort}/ob/notifications`,
      json: true, // Automatically stringifies the body to JSON
      headers: {
        Authorization: config.apiCredentials,
      },
      // resolveWithFullResponse: true
    };

    return rp(options);
  } catch (err) {
    console.error(`Error in openbazaar.js/getNotifications(): ${err}`);
    console.error(`Error stringified: ${JSON.stringify(err, null, 2)}`);
    throw err;
  }
}
504903
function () {
                    HealthLogger.sendAnalyticsData(
                        autoUpdateEventNames.AUTOUPDATE_DOWNLOAD_COMPLETE_USER_CLICK_RESTART,
                        "autoUpdate",
                        "installNotification",
                        "installNow ",
                        "click"
                    );
                    detachUpdateBarBtnHandlers();
                    initiateUpdateProcess(statusObj.installerPath, statusObj.logFilePath, statusObj.installStatusFilePath);
                }
1181717
function notify(gobj, source) {
	const state = gobj.__gawk__;

	if (source === undefined) {
		source = gobj;
	}

	// if we're paused, add this object to the list of objects that may have changed
	if (state.queue) {
		state.queue.add(gobj);
		return;
	}

	// notify all of this object's listeners
	if (state.listeners) {
		for (const [ listener, filter ] of state.listeners) {
			if (filter) {
				const { found, obj } = filterObject(gobj, filter);

				// compute the hash of the stringified value
				const hash = hashValue(obj);

				// check if the value changed
				if ((found && !state.previous) || (state.previous && hash !== state.previous.get(listener))) {
					listener(obj, source);
				}

				if (!state.previous) {
					state.previous = new WeakMap();
				}

				state.previous.set(listener, hash);
			} else {
				listener(gobj, source);
			}
		}
	}

	// notify all of this object's parents
	if (state.parents) {
		for (const parent of state.parents) {
			notify(parent, source);
		}
	}
}
663407
function notifyAccess({object, name}) {

    // Create an observer for changes in properties accessed during execution of this function.
    function makeAccessedObserver() {
      return Observer(object, function(changes) {
        changes.forEach(({type, name}) => {
          var {names} = accessEntry;
          if (!names || type === 'update' && names.indexOf(name) !== -1)
            rerun();
        });
      });
    }

    // Make a new entry in the access table, containing initial property name if any
    // and observer for properties accessed on the object.
    function makeAccessEntry() {
      accesses.set(object, {
        names:    name ? [name] : null,
        observer: makeAccessedObserver()
      });
    }

    // If properties on this object are already being watched, there is already an entry
    // in the access table for it. Add a new property name to the existing entry.
    function setAccessEntry() {
      if (name && accessEntry.names) accessEntry.names.push(name);
      else accessEntry.names = null;
    }

    var accessEntry = accesses.get(object);
    if (accessEntry) setAccessEntry();
    else makeAccessEntry();
  }
37639
def donotify(nick, rest):
	""
	opts = rest.split(' ')
	to = opts[0]
	Notify.store.notify(nick, to, ' '.join(opts[1:]))
	return "Will do!"
401011
def _update(self):
        """"""
        update = not self._reminders

        with self._lock:
            for fname in self._reminders:
                if getmtime(fname) > self._mtime:
                    update = True
                    break

            if update:
                self._reminders = self._parse_remind(self._filename)
1101245
def user_update(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_openstack_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    if 'new_name' in kwargs:
        kwargs['name'] = kwargs.pop('new_name')
    return cloud.update_user(**kwargs)
1293292
def update(self, access_token=None, id_token=None, id_token_jwt=None, userinfo=None):
        

        def set_if_defined(session_key, value):
            if value:
                self._session_storage[session_key] = value

        auth_time = int(time.time())
        if id_token:
            auth_time = id_token.get('auth_time', auth_time)

        self._session_storage['last_authenticated'] = auth_time
        set_if_defined('access_token', access_token)
        set_if_defined('id_token', id_token)
        set_if_defined('id_token_jwt', id_token_jwt)
        set_if_defined('userinfo', userinfo)
649585
def on_expired(self):
        """"""

        print('Authentication expired')

        # Authentication expired
        self.is_authenticating.acquire()
        self.is_authenticating.notify_all()
        self.is_authenticating.release()
71626
def _start_update_server(auth_token):
    """"""
    server = AccumulatorServer(("localhost", 0), _UpdateRequestHandler, auth_token)
    thread = threading.Thread(target=server.serve_forever)
    thread.daemon = True
    thread.start()
    return server