Sets the current user id in all appropriate contexts and reruns all subscriptions
489921
function(userId) {
    var self = this;

    if (userId !== null && typeof userId !== "string")
      throw new Error("setUserId must be called on string or null, not " +
                      typeof userId);

    // Prevent newly-created universal subscriptions from being added to our
    // session; they will be found below when we call startUniversalSubs.
    //
    // (We don't have to worry about named subscriptions, because we only add
    // them when we process a 'sub' message. We are currently processing a
    // 'method' message, and the method did not unblock, because it is illegal
    // to call setUserId after unblock. Thus we cannot be concurrently adding a
    // new named subscription.)
    self._dontStartNewUniversalSubs = true;

    // Prevent current subs from updating our collectionViews and call their
    // stop callbacks. This may yield.
    self._eachSub(function (sub) {
      sub._deactivate();
    });

    // All subs should now be deactivated. Stop sending messages to the client,
    // save the state of the published collections, reset to an empty view, and
    // update the userId.
    self._isSending = false;
    var beforeCVs = self.collectionViews;
    self.collectionViews = {};
    self.userId = userId;

    // Save the old named subs, and reset to having no subscriptions.
    var oldNamedSubs = self._namedSubs;
    self._namedSubs = {};
    self._universalSubs = [];

    _.each(oldNamedSubs, function (sub, subscriptionId) {
      self._namedSubs[subscriptionId] = sub._recreate();
      // nb: if the handler throws or calls this.error(), it will in fact
      // immediately send its 'nosub'. This is OK, though.
      self._namedSubs[subscriptionId]._runHandler();
    });

    // Allow newly-created universal subs to be started on our connection in
    // parallel with the ones we're spinning up here, and spin up universal
    // subs.
    self._dontStartNewUniversalSubs = false;
    self.startUniversalSubs();

    // Start sending messages again, beginning with the diff from the previous
    // state of the world to the current state. No yields are allowed during
    // this diff, so that other changes cannot interleave.
    Meteor._noYieldsAllowed(function () {
      self._isSending = true;
      self._diffCollectionViews(beforeCVs);
      if (!_.isEmpty(self._pendingReady)) {
        self.sendReady(self._pendingReady);
        self._pendingReady = [];
      }
    });
  }
234576
def get_subscriptions(self, limit=100, offset=0, params={}):
        
        url = self.SUBSCRIPTIONS_URL + "?limit=%s&offset=%s" % (limit, offset)

        for key, value in params.items():
            if key is 'ids':
                value = ",".join(value)

            url += '&%s=%s' % (key, value)

        connection = Connection(self.token)
        connection.set_url(self.production, url)

        return connection.get_request()
423333
public void reloadUsers(int contextId) {
		List<User> users = usersExtension.getContextUserAuthManager(contextId).getUsers();
		User[] usersArray = users.toArray(new User[users.size()]);
		ListModel<User> usersModel = new DefaultComboBoxModel<User>(usersArray);
		this.setModel(usersModel);
	}
1055126
def list_by_subscription_id(custom_headers:nil)
      response = list_by_subscription_id_async(custom_headers:custom_headers).value!
      response.body unless response.nil?
    end
1212464
private void refreshId()
	{
		if (null == getName())
		{
			setId(null);
		}
		else
		{
			if (null == getIdSuffix())
			{
				setId(getName());
			}
			else
			{
				setId(getName() + getIdSuffix());
			}
		}
	}
1310640
def user_update(object_id, input_params={}, always_retry=False, **kwargs):
    
    return DXHTTPRequest('/%s/update' % object_id, input_params, always_retry=always_retry, **kwargs)
257809
def reset_subscriptions(self, accounts=[], markets=[], objects=[]):
        
        self.websocket.reset_subscriptions(
            accounts, self.get_market_ids(markets), objects
        )
1062209
protected function updateUsers()
    {
        $user_id = $this->getAuthUserId();
        if (!($user_id > 0)) {
            return;
        }

        if (!$this->isDirty('updated_by')) {
            $this->updated_by = $user_id;
        }

        if (!$this->exists && !$this->isDirty('created_by')) {
            $this->created_by = $user_id;
        }
    }
559577
def update_user(self):
        
        # First create a copy of the current user
        user_dict = self.serialize()
        # Then delete the entities in the description field
        del user_dict['description']['entities']
        # Then upload user_dict
        user, meta = self._api.update_user('me', data=user_dict)
166321
function () {
    var self = this;
    _.each(_.clone(self._subscriptions), function (sub, id) {
      // Avoid killing the autoupdate subscription so that developers
      // still get hot code pushes when writing tests.
      //
      // XXX it's a hack to encode knowledge about autoupdate here,
      // but it doesn't seem worth it yet to have a special API for
      // subscriptions to preserve after unit tests.
      if (sub.name !== 'meteor_autoupdate_clientVersions') {
        self._send({msg: 'unsub', id: id});
        delete self._subscriptions[id];
      }
    });
  }
177632
def delete_subscription(self, subscription_id):
        
        return self.client._delete(self.url + 'subscriptions/{}'.format(subscription_id), headers=self.get_headers())
452666
def finish_user(self, subid):
    ''''''        

    p = self.revoke_token(subid)
    p.token = "finished"
    self.session.commit()
    return p
1010675
def run(self):
        
        from zengine.models import User
        user = User(username=self.manager.args.username, superuser=self.manager.args.super)
        user.set_password(self.manager.args.password)
        user.save()
        print("New user created with ID: %s" % user.key)
92775
def update_subscription(self, subscription_id, url=None, events=None):
        
        params = {}

        if url is not None:
            params['url'] = url

        if events is not None:
            params['events'] = events

        url = self.SUBSCRIPTIONS_ID_URL % subscription_id

        connection = Connection(self.token)
        connection.set_url(self.production, url)
        connection.add_header('Content-Type', 'application/json')
        connection.add_params(params)

        return connection.patch_request()
1020228
public function setUserID()
    {
        $response = $this->get("me");
        $config = SiteConfig::current_site_config();
        $config->HailUserID = $response['id'];
        $this->user_id = $response['id'];
        $config->write();
    }
189757
def subscribe(self, user, verbose=None):
        
        if not self.email_enabled:
            raise EmailNotEnabledError("See settings.EMAIL_ENABLED")
        if not user.email:
            raise UserEmailError(f"User {user}'s email address is not defined.")
        response = requests.post(
            f"{self.api_url}/{self.address}/members",
            auth=("api", self.api_key),
            data={
                "subscribed": True,
                "address": user.email,
                "name": f"{user.first_name} {user.last_name}",
                "description": f'{user.userprofile.job_title or ""}',
                "upsert": "yes",
            },
        )
        if verbose:
            sys.stdout.write(
                f"Subscribing {user.email} to {self.address}. "
                f"Got response={response.status_code}.\n"
            )
        return response
552054
def enable_selfalias(config, id_name):
    

    def context_found_subscriber(event):
        request = event.request
        user = getattr(request, 'user', None)
        if (request.matchdict and
                request.matchdict.get(id_name, None) == 'self' and
                user):
            request.matchdict[id_name] = user.username

    config.add_subscriber(context_found_subscriber, ContextFound)